Re: objectForKey:self
Re: objectForKey:self
- Subject: Re: objectForKey:self
- From: Jonathan del Strother <email@hidden>
- Date: Mon, 26 Jun 2006 16:52:28 +0100
On 26 Jun 2006, at 16:39, Nick Zitzmann wrote:
On Jun 26, 2006, at 6:05 AM, Jonathan del Strother wrote:
The instance variables are then looked up by using the instance
pointer as the key. Here's the strange part - I was using
objectForKey:self, and it worked fine on my Powerbook, but seemed
to break everywhere else. Replacing that with objectForKey:
[NSNumber numberWithInt:self] seems to work fine, regardless of
the environment.
Can anyone explain why objectForKey:self works in some places but
not others?
Does the "self" class support NSCopying? You can't use objects as
keys in dictionaries if the objects don't support NSCopying.
True, and no - NSWindow/BrowserWindow don't support NSCopying. Which
explains why it's likely to break when I use objectForKey:self....
it just doesn't explain why it worked flawlessly on my Powerbook.
Odd...
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden