I have a question for the Mac using objective C gurus on the list. Given this code snippet to get UUID strings from Cocoa, can somebody give me a code snippet in VisualWorks that will get me a UUID string created using the ObjectveC Runtime package? I know I can get one from the shell, but they are really slow. On windows I use COM, and on linux I use libUUID and can get them hundreds of times faster than the shell.
Thanks, Mike + (NSString*) stringWithNewUUID { //create a new UUID CFUUIDRef uuidObj = CFUUIDCreate(nil); //get the string representation of the UUID NSString *newUUID = (NSString*)CFUUIDCreateString(nil, uuidObj); CFRelease(uuidObj); return [newUUID autorelease]; } _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
Mike,
if you can post an equivalent Carbon code snippet, it should be an evening hack to implement that with DLLCC. Someone else on this list (sorry, I forgot who) was working on an Objective-C bridge. I recall that that requires a specially patched VM, which seems a bit overkill for your request ;-) R - On Mar 6, 2008, at 9:05 PM, Mike Hales wrote: > I have a question for the Mac using objective C gurus on the list. > Given this code snippet to get UUID strings from Cocoa, can somebody > give me a code snippet in VisualWorks that will get me a UUID string > created using the ObjectveC Runtime package? I know I can get one > from the shell, but they are really slow. On windows I use COM, and > on linux I use libUUID and can get them hundreds of times faster > than the shell. > > Thanks, > > Mike > > + (NSString*) stringWithNewUUID > { > //create a new UUID > CFUUIDRef uuidObj = CFUUIDCreate(nil); > //get the string representation of the UUID > NSString *newUUID = (NSString*)CFUUIDCreateString(nil, uuidObj); > CFRelease(uuidObj); > return [newUUID autorelease]; > } > _______________________________________________ > vwnc mailing list > [hidden email] > http://lists.cs.uiuc.edu/mailman/listinfo/vwnc _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
In reply to this post by Mike Hales
I'm not sure about ObjectiveC Connect.. but with ObjectiveC-2.0 Runtime
in public store you can write: NSProcessInfo processInfo globallyUniqueString I also found another class that creates UUIDs by using Searchlight and ObjectiveC-2.0 Runtime Tools: _PFRoutines _getUUID Cheers, Michael Mike Hales wrote: > I have a question for the Mac using objective C gurus on the list. > Given this code snippet to get UUID strings from Cocoa, can somebody > give me a code snippet in VisualWorks that will get me a UUID string > created using the ObjectveC Runtime package? I know I can get one > from the shell, but they are really slow. On windows I use COM, and > on linux I use libUUID and can get them hundreds of times faster than > the shell. > > Thanks, > > Mike > > + (NSString*) stringWithNewUUID > { > //create a new UUID > CFUUIDRef uuidObj = CFUUIDCreate(nil); > //get the string representation of the UUID > NSString *newUUID = (NSString*)CFUUIDCreateString(nil, uuidObj); > CFRelease(uuidObj); > return [newUUID autorelease]; > } > ------------------------------------------------------------------------ > > _______________________________________________ > vwnc mailing list > [hidden email] > http://lists.cs.uiuc.edu/mailman/listinfo/vwnc > _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
I just want to mention that testing 'ObjectiveC-2.0 Runtime' on MacOSX
10.4 showed that it requires MacOSX 10.5 ;-) Roland -- Roland Wagener * Senior Consultant * [hidden email] Tel: x49-231-9 75 99-26 Fax: x49-231-9 75 99-20 Georg Heeg eK Dortmund Handelsregister: Amtsgericht Dortmund A 12812 Michael Lucas-Smith schrieb: > I'm not sure about ObjectiveC Connect.. but with ObjectiveC-2.0 Runtime > in public store you can write: > > NSProcessInfo processInfo globallyUniqueString > > I also found another class that creates UUIDs by using Searchlight and > ObjectiveC-2.0 Runtime Tools: > > _PFRoutines _getUUID > > Cheers, > Michael > > > Mike Hales wrote: >> I have a question for the Mac using objective C gurus on the list. >> Given this code snippet to get UUID strings from Cocoa, can somebody >> give me a code snippet in VisualWorks that will get me a UUID string >> created using the ObjectveC Runtime package? I know I can get one >> from the shell, but they are really slow. On windows I use COM, and >> on linux I use libUUID and can get them hundreds of times faster than >> the shell. >> >> Thanks, >> >> Mike >> >> + (NSString*) stringWithNewUUID >> { >> //create a new UUID >> CFUUIDRef uuidObj = CFUUIDCreate(nil); >> //get the string representation of the UUID >> NSString *newUUID = (NSString*)CFUUIDCreateString(nil, uuidObj); >> CFRelease(uuidObj); >> return [newUUID autorelease]; >> } >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> vwnc mailing list >> [hidden email] >> http://lists.cs.uiuc.edu/mailman/listinfo/vwnc >> > > _______________________________________________ > vwnc mailing list > [hidden email] > http://lists.cs.uiuc.edu/mailman/listinfo/vwnc > > vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
Free forum by Nabble | Edit this page |