• 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: Generating Unique ID
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Generating Unique ID
      • From: Bill Cheeseman <email@hidden>
References: 
 >Re: Generating Unique ID (From: Chris Hanson <email@hidden>)

  • Prev by Date: Re: Newbie question: forcing data format during saveDocumentTo:
  • Next by Date: Re: Controlling the Open Recent menu
  • Previous by thread: Re: Generating Unique ID
  • Next by thread: Re: Generating Unique ID
  • Index(es):
    • Date
    • Thread