Using static NSString as observation context
Shawn Erickson
shawnce at gmail.com
Sun May 18 11:29:57 PDT 2008
On Sat, May 17, 2008 at 7:44 PM, Rob Keniger <rob at menumachine.com> wrote:
>
> On 17/05/2008, at 11:59 PM, Christiaan Hofman wrote:
>
>> I have recently changed some KVO observation code to us a static NSString
>> as the context when registering as KVO observation. However now that seems
>> to have introduced a crasher when removing the observer, at least on a Core
>> Duo Intel machine. PPC does not seem to have any problem. So is there some
>> problem using NSStrings as observation context for Intel? The Sketch sample
>> code also uses those.
>
>
> I've not had a problem, but I cast the string to a void*. I use a definition
> like this:
>
> static void* MyObservationContext=(void*) @"MyObservationContext";
What is the point of doing this? Why are you trying to throw away type
information?
-Shawn
More information about the MacOSX-dev
mailing list