Skip navigation.
 
mlRe: Using static NSString as observation context
FROM : Shawn Erickson
DATE : Sun May 18 20:29:57 2008

On Sat, May 17, 2008 at 7:44 PM, Rob Keniger <<email_removed>> 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

Related mailsAuthorDate
mlUsing static NSString as observation context Christiaan Hofman May 17, 15:59
mlRe: Using static NSString as observation context Rob Keniger May 18, 04:44
mlRe: Using static NSString as observation context Christiaan Hofman May 18, 12:23
mlRe: Using static NSString as observation context Christiaan Hofman May 18, 12:33
mlRe: Using static NSString as observation context Shawn Erickson May 18, 20:29
mlRe: Using static NSString as observation context Christiaan Hofman May 18, 22:27
mlRe: Using static NSString as observation context Scott Stevenson May 19, 00:45
mlRe: Using static NSString as observation context Rob Keniger May 19, 03:15
mlRe: Using static NSString as observation context Shawn Erickson May 19, 17:07
mlRe: Using static NSString as observation context Christiaan Hofman May 19, 17:21
mlRe: Using static NSString as observation context Shawn Erickson May 19, 17:39
mlRe: Using static NSString as observation context Christiaan Hofman May 19, 18:48
mlRe: Using static NSString as observation context Paul Sargent May 19, 19:56
mlRe: Using static NSString as observation context Christiaan Hofman May 19, 20:00
mlRe: Using static NSString as observation context Christiaan Hofman May 27, 14:56
mlRe: Using static NSString as observation context Ken Ferry May 27, 19:49
mlRe: Using static NSString as observation context Christiaan Hofman May 27, 20:16
mlRe: Using static NSString as observation context Fritz Anderson May 27, 20:41
mlRe: Using static NSString as observation context Christiaan Hofman May 27, 21:10