• 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: Question Regarding the Memory Address of Objects
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Question Regarding the Memory Address of Objects


  • Subject: Re: Question Regarding the Memory Address of Objects
  • From: "Michael Ash" <email@hidden>
  • Date: Thu, 18 Dec 2008 17:05:49 -0500

On Thu, Dec 18, 2008 at 3:53 PM, Carter R. Harrison
<email@hidden> wrote:
> Once again you have saved me from pulling my hair out.  Thank you once again
> for your assistance.  For the rest of the folks on the thread the solution
> was to remove the "&" from the front of all my pointers.

I'd suggest that your basic approach isn't really very good. For one
thing, it'll break on 64-bit (%x is an int, which is still 32-bit).
Even if you fix that, generating a string with a pointer value is a
pretty baroque way to do what you're doing.

If you can require 10.5, simply use NSMapTable. It works like an
NSDictionary but can take arbitrary (non-NSCopying) pointers as keys,
when properly configured.

If you must run on 10.4 or below, either use CFDictionary with
customized callbacks (and *don't* use the toll-free bridging support
if you do, TFB'd CFDictionaries will copy their keys even if you tell
them not to) or use [NSValue valueWithPointer:] to generate keys.

Mike
_______________________________________________

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

References: 
 >Question Regarding the Memory Address of Objects (From: "Carter R. Harrison" <email@hidden>)
 >Re: Question Regarding the Memory Address of Objects (From: David Duncan <email@hidden>)
 >Re: Question Regarding the Memory Address of Objects (From: "Carter R. Harrison" <email@hidden>)

  • Prev by Date: Re: [Q] availableTypeFromArray returns NXFileContentsPboardType instead of NSFileContentsPboardType
  • Next by Date: Debugging a Plugin
  • Previous by thread: Re: Question Regarding the Memory Address of Objects
  • Next by thread: Re: Question Regarding the Memory Address of Objects
  • Index(es):
    • Date
    • Thread