Re: UUID Generation in Cocoa
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.