Let us say that I have a method like this:
- (NSDictionary*)getBigDictionaryOfSecrets
{
NSDictionary *theDic = [[NSDictionary alloc] init];
theDic = // insert contents of dictionary
return theDic;
}
How and where should one properly release this?
Try
return [theDic autorelease]. This will not release the dictionary immediately, allowing the caller toretainit.