• 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: Do IMPs move once they're loaded?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Do IMPs move once they're loaded?


  • Subject: Re: Do IMPs move once they're loaded?
  • From: Brendan Younger <email@hidden>
  • Date: Sat, 29 Jan 2005 22:08:57 -0600


On Jan 29, 2005, at 9:11 PM, mmalcolm crawford wrote:


On Jan 29, 2005, at 6:25 PM, Ken Tozier wrote:

Once it's in memory, yes. But the dilemma was how to store a selector along with the data the selector operates on to disk when the selector itself isn't a fixed length and Apple doesn't guarantee identical hash values for the identical strings between OS releases.
At any rate, I got it working now. I wrote my own hashing function (which I won't change between OS releases), store the selector strings in an NSDictionary in the "initialize" method, and resolve them as needed with NSSelectorFromString

Perhaps NSInvocation would be more appropriate?
<http://developer.apple.com/documentation/Cocoa/Reference/Foundation/ ObjC_classic/Classes/NSInvocation.html>
(Note that it conforms to NSCoding, and instances can be put in arrays and dictionaries.)

Bad idea. NSInvocation only conforms to NSCoding to support NSPortCoder; it shouldn't be archived.


As for the original poster's dilemma, there is no need to write your own hash function; sheesh, just put the selector strings in an NSDictionary and grab them later. Anyway, trying to get an optimized special-case method called for a particular object is what subclasses were invented for. Manually fooling around trying to determine which type of object you're handling is terrible design.

Brendan Younger

_______________________________________________
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: Do IMPs move once they're loaded?
      • From: mmalcolm crawford <email@hidden>
    • Re: Do IMPs move once they're loaded?
      • From: Ken Tozier <email@hidden>
References: 
 >Do IMPs move once they're loaded? (From: Ken Tozier <email@hidden>)
 >Re: Do IMPs move once they're loaded? (From: Sherm Pendley <email@hidden>)
 >Re: Do IMPs move once they're loaded? (From: Ken Tozier <email@hidden>)
 >Re: Do IMPs move once they're loaded? (From: Bob Ippolito <email@hidden>)
 >Re: Do IMPs move once they're loaded? (From: Ken Tozier <email@hidden>)
 >Re: Do IMPs move once they're loaded? (From: mmalcolm crawford <email@hidden>)

  • Prev by Date: Re: Default Nib on Document based apps
  • Next by Date: RE: Default Nib on Document based apps
  • Previous by thread: Re: Do IMPs move once they're loaded?
  • Next by thread: Re: Do IMPs move once they're loaded?
  • Index(es):
    • Date
    • Thread