• 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
objectForKey:self
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

objectForKey:self


  • Subject: objectForKey:self
  • From: Jonathan del Strother <email@hidden>
  • Date: Mon, 26 Jun 2006 13:05:22 +0100

I've created a SIMBL hack that uses poseAsClass to swap in my own subclass of Safari's BrowserWindow class. Because poseAsClass doesn't allow you to add your own instance variables, I've stored them in a global NSDictionary.

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?

Jon
_______________________________________________
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: Nick Zitzmann <email@hidden>
  • Prev by Date: Posting to NotificationCenter from an Open Source app
  • Next by Date: Displaying the contextual menu in the fullscreen window
  • Previous by thread: Re: Posting to NotificationCenter from an Open Source app
  • Next by thread: Re: objectForKey:self
  • Index(es):
    • Date
    • Thread