Re: KVO can be unsafe in -init?
Re: KVO can be unsafe in -init?
- Subject: Re: KVO can be unsafe in -init?
- From: Dave Keck <email@hidden>
- Date: Wed, 9 Sep 2009 00:21:03 -1000
> What do I use. Normally a class static, provided that's granular enough,
> always has been for me thus far. Either just make some static thing like a
> character array and take the address of it or, as I've been doing
recently,
> use the address of the class object which I grab in a +initialize() method
> (taking care again to check I'm not being called for a subclass) and stuff
> into a static I kept for the
> purpose.
Personally, for my KVO contexts, I use:
static void *const MyClass_KVOContext = (void *)&MyClass_KVOContext;
I've never seen anyone else use it, but I find it to be the cleanest
solution - although it certainly looks strange at first glance. :)
_______________________________________________
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