Re: How can I get an instance specific identifier?
Re: How can I get an instance specific identifier?
- Subject: Re: How can I get an instance specific identifier?
- From: "Martin" <email@hidden>
- Date: Mon, 27 Nov 2006 17:04:23 -0800
>> I want to use the memory location (eg 0x3a1c30) as the identifier for
>> the object. This would be for storing info in a dictionary, the memory
>> location would be used as the key.
>
> [NSValue valueWithPointer:object]
If the address you are using as a key is a real object (eg: inherits from NSObject), then there is also [NSValue valueWithNonretainedObject:object].
Whatever method you use, be aware that the memory address is only unique until the object deallocates. After that, the address can be reused by new objects.
~Martin
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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