• 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: UUID Generation in Cocoa
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: UUID Generation in Cocoa


  • Subject: Re: UUID Generation in Cocoa
  • From: Joseph Jones <email@hidden>
  • Date: Sat, 18 Jan 2003 22:33:09 -0800

Works like a charm.

Thanx,
joe

On Saturday, January 18, 2003, at 10:11 PM, Scott Anguish wrote:


On Saturday, January 18, 2003, at 11:37 PM, Joseph Jones wrote:

Is there a set of API's or objects in Cocoa that generate and work with UUIDs? After a LONG while of digging around I located Carbon APIs for this, but I'd like to stick to Obj C and Cocoa as much as > possible.


I've used this category for making UUID strings


@implementation NSString(uuid)

+ (NSString *)uniqueString
{
CFUUIDRef uuid = CFUUIDCreate(NULL);
CFStringRef uuidStr = CFUUIDCreateString(NULL, uuid);
CFRelease(uuid);
[(NSString *)uuidStr autorelease];
return (NSString *)uuidStr;
}

@end
_______________________________________________
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:
    • Memory management questions using UUID example
      • From: Brian Gilman <email@hidden>
References: 
 >Re: UUID Generation in Cocoa (From: Scott Anguish <email@hidden>)

  • Prev by Date: Re: UUID Generation in Cocoa
  • Next by Date: Re: Question about keyboard shortcuts
  • Previous by thread: Re: UUID Generation in Cocoa
  • Next by thread: Memory management questions using UUID example
  • Index(es):
    • Date
    • Thread