On 18 May 2010, at 23:58, Abhinay Kartik Reddyreddy wrote:

>       static NSMutableDictionary* uniqueInstance = nil;
> // the static variable has to be initialized before  you enter the 
> uniqueInstance method.

Not true.  Static variables are initialised to nil (or zero) automatically (it 
says so in the C standard, §5.1.2 - "All objects with static storage duration 
shall be initialized (set to their initial values) before program startup.").  
Further, it's entirely acceptable to write the static variable declaration 
inside the +uniqueInstance method... that controls the scope of the variable 
name, not its lifetime (which was already defined by the use of the "static" 
keyword).

Neither of those things are the problem... as Mike says, we'd need a stack 
backtrace to see where the problem lies, and it doesn't look as if it's in this 
method.

Kind regards,

Alastair.

-- 
http://alastairs-place.net



_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to