Re: Generating Unique ID
Re: Generating Unique ID
- Subject: Re: Generating Unique ID
- From: Georg Tuparev <email@hidden>
- Date: Fri, 5 Sep 2003 07:40:02 +0200
On Thursday, September 4, 2003, at 11:41 PM, Chris Hanson wrote:
On Thursday, September 4, 2003, at 10:14 AM, G Douglas Davidson wrote:
I'd like to tag all of my Object/Records with a Unique ID not tied to
the data in any way and unique across objects. I remember seeing
something in Apple's documentation about some function that produced
this Unique number (does not have to be across machines.) But I
can't seem to find it.
CoreFoundation has CFUUIDRef, which is very easy to either create and
turn into an NSString* (since CFStringRef is toll-free bridged with
NSString*) or to wrap in your own UniqueID class.
This should actually generate UIDs that are unique across machines as
well as on your machine.
Because this is a Cocoa list, this should be mentioned too:
NSString *guid = [[NSProcessInfo processInfo] globallyUniqueString];
...
Georg Tuparev
Tuparev Technologies
Klipper 13
1186 VR Amstelveen
The Netherlands
Mobile: +31-6-55798196
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.