Re: UUID Generation in Cocoa
Re: UUID Generation in Cocoa
- Subject: Re: UUID Generation in Cocoa
- From: Scott Anguish <email@hidden>
- Date: Sun, 19 Jan 2003 01:11:37 -0500
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.