Re: Strings from UUID
Re: Strings from UUID
- Subject: Re: Strings from UUID
- From: Jim Correia <email@hidden>
- Date: Fri, 9 Aug 2002 14:54:48 -0400
On Friday, August 9, 2002, at 02:33 PM, Jeremy Dronfield wrote:
- (IBAction)generateAction:(id)sender
{
NSString *myString;
CFUUIDRef myUUID;
CFStringRef myUUIDString;
char strBuffer[100];
myUUID = CFUUIDCreate(kCFAllocatorDefault);
You create this - you must CFRelease it later.
myUUIDString = CFUUIDCreateString(kCFAllocatorDefault, myUUID);
Same here.
CFStringGetCString(myUUIDString, strBuffer, 100,
kCFStringEncodingASCII);
myString = [NSString stringWithFormat:@"%s", strBuffer];
[textView1 setString:myString];
}
NSString and CFString are toll-free bridged.
[textView1 setString: (NSString *)myUUIDString]
will do the trick in one step.
Jim
_______________________________________________
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.