• 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: Hash Values in Custom Classes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Hash Values in Custom Classes


  • Subject: Re: Hash Values in Custom Classes
  • From: Sean McBride <email@hidden>
  • Date: Mon, 28 Mar 2011 14:06:55 -0400
  • Organization: Rogue Research Inc.

On Sat, 26 Mar 2011 02:23:42 +0100, Peter Lübke said:

>To be more detailed: my custom class and its subclasses are wrapper
>classes containing file informations. They are based on FSRef rather
>than using paths - I do a lot of lengthy iterations so paths are much
>too fragile. I also heavily use NSSet to store instances, and I
>wanted -isEqual: to be as fast as possible. So I thought I could just
>return a unique hash value for each custom class and return
>(FSCompareFSRefs (&ownRef, &otherRef) == noErr) for -isEqual:, thus
>avoiding the need to *first* compare the objects' classes.

Are you aware that starting in 10.6, the OS provides 'file reference
URLs' which are much like FSRefs.  See:

<http://developer.apple.com/library/mac/#releasenotes/Cocoa/Foundation.html>

--
____________________________________________________________
Sean McBride, B. Eng                 email@hidden
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Hash Values in Custom Classes
      • From: Peter Lübke <email@hidden>
References: 
 >Hash Values in Custom Classes (From: Peter Lübke <email@hidden>)
 >Re: Hash Values in Custom Classes (From: Mike Abdullah <email@hidden>)
 >Re: Hash Values in Custom Classes (From: Peter Lübke <email@hidden>)

  • Prev by Date: Font Height and -[NSString sizeWithAttributes:]
  • Next by Date: Re: Font Height and -[NSString sizeWithAttributes:]
  • Previous by thread: Re: Hash Values in Custom Classes
  • Next by thread: Re: Hash Values in Custom Classes
  • Index(es):
    • Date
    • Thread