• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: objectForKey:self
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: objectForKey:self


  • Subject: Re: objectForKey:self
  • From: Nick Zitzmann <email@hidden>
  • Date: Mon, 26 Jun 2006 09:39:39 -0600


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.


Nick Zitzmann
<http://www.chronosnet.com/>




_______________________________________________ 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
  • Follow-Ups:
    • Re: objectForKey:self
      • From: Jonathan del Strother <email@hidden>
References: 
 >objectForKey:self (From: Jonathan del Strother <email@hidden>)

  • Prev by Date: Re: Problem with setKeyEquivalentModifierMask
  • Next by Date: Re: Implementing Undo for a Cut operation, against an NSManagedObject
  • Previous by thread: objectForKey:self
  • Next by thread: Re: objectForKey:self
  • Index(es):
    • Date
    • Thread