Re: NSNumber pointerValue
Re: NSNumber pointerValue
- Subject: Re: NSNumber pointerValue
- From: Wade Tregaskis <email@hidden>
- Date: Tue, 18 Nov 2003 20:27:58 +1100
Does anybody know why this would yield different results before and
after being on the pasteboard?
Presumably NSValue assumes if it's going into a pasteboard that
pointer references are no longer valid, so it then returns nil.
How would it know its a pointer? I'm typcasting it into an integer
value?
Sorry, you're right - my original description was backwards. What I
meant to say is that, it seems like the NSValue is notified when it's
added to a pasteboard, through whatever mechanism, and when that
happens it latches some internal state which says that from then on
pointerValue will return nil. At least until it is set to something
else.
But this is just speculation, of course. Maybe someone at Apple wants
to clarify, but probably not. You could test further by seeing if your
original object can get a non-nil value back *after* placing the
NSNumber into the pasteboard. If it can, then either (a) I'm wrong or
(b) the trigger happens when the value is retrieved, not set.
It seems the more intuitive design to trigger when the value is
retrieved, not set, but it probably depends on what mechanism is used
to do this. Presumably there's some sort of coding go on at some
point...?
Wade Tregaskis
-- Sed quis custodiet ipsos custodes?
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.