Re: proper way to release a static NSMutableDictionary?
Re: proper way to release a static NSMutableDictionary?
- Subject: Re: proper way to release a static NSMutableDictionary?
- From: Andrew Farmer <email@hidden>
- Date: Mon, 15 Dec 2008 15:33:35 -0800
On 15 Dec 08, at 14:54, John Michael Zorko wrote:
Imagine this:
static NSMutableDictionary *lookup = [NSMutableDictionary new];
... now imagine a situation where I need to clear that dictionary.
If I call
[lookup release];
lookup = [NSMutableDictionary new];
... it will obviously be faster than coding a for loop and removing
each object in the dictionary, but since it was declared as static,
which is safer?
Neither. All that "static" means on a global variable is that the
symbol isn't visible from other source files. It has no bearing
whatsoever on the contents of that variable.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden