Code:
NSString *plistPath = [[NSBundle mainBundle] pathForResource:@"mylist" ofType:@"plist"];
NSDictionary *dict = [NSDictionary dictionaryWithContentsOfFile:plistPath];
self.locationList = [dict valueForKey:@"location"];
[dict release];
You did not alloc, copy, new, or retain dict, so don't release it.
Quote:
Originally Posted by unplug
Code:
[myInstanceVariable release], myInstanceVariable = nil;
Do I have to use both, or just one? I think they are the same, right?
|
You don't
have to use both, and it probably doesn't matter in dealloc (use release). Elsewhere in code, it's a defensive coding measure. No, they are not the same thing.