• 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: Need localization-proof method of transporting dates.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Need localization-proof method of transporting dates.


  • Subject: Re: Need localization-proof method of transporting dates.
  • From: Uli Kusterer <email@hidden>
  • Date: Sun, 5 Apr 2009 17:58:38 +0200

On 05.04.2009, at 17:15, Michael Ash wrote:
Note that, as far as I know, there is no guarantee that -hash will
return the same value for the same object across runs of your program.


Good point. It's not too likely that a hash would be different between launches (after all, a hash is of the value, there's no sense in including the pointer, because pointer comparisons are already fast and don't need a hash), but it's surely possible that the algorithm could change betwen OS releases or include some element unique to a particular machine to take advantage of hardware features or the like.

Also, it's very likely the hash isn't the same between the 64-bit and 32-bit runtimes. After all, it's an NSUInteger, which is an unsigned long long on 64 bit, but an unsigned long on 32 bit. If you have twice as many bits available for storing your hash, the runtime is likely generating more widely distributed hashes to take advantage of that.

In fact, that sounds like a much more likely source of the bug than an issue with serializing NSDate. Is your app compiled for 64 bit? Is one of the Mac CPUs in question 32-bit and the other 64-bit?

Cheers,
-- Uli Kusterer
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de





_______________________________________________

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: Need localization-proof method of transporting dates.
      • From: Michael Ash <email@hidden>
References: 
 >Re: Need localization-proof method of transporting dates. (From: Greg Guerin <email@hidden>)
 >Re: Need localization-proof method of transporting dates. (From: Graham Cox <email@hidden>)
 >Re: Need localization-proof method of transporting dates. (From: Michael Ash <email@hidden>)

  • Prev by Date: Re: Beachball on Lengthy Task
  • Next by Date: Re: Very interesting ordering caveat with NSArray arrayWithObjects:
  • Previous by thread: Re: Need localization-proof method of transporting dates.
  • Next by thread: Re: Need localization-proof method of transporting dates.
  • Index(es):
    • Date
    • Thread