Skip to content

Instantly share code, notes, and snippets.

@jiggak
Created November 11, 2013 13:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jiggak/7413301 to your computer and use it in GitHub Desktop.
Save jiggak/7413301 to your computer and use it in GitHub Desktop.
print UUID to stdout
// xcrun gcc -framework Foundation -o uuid uuid.m
#import <Foundation/Foundation.h>
#include <stdio.h>
int main(int argc, char **argv) {
CFUUIDRef uuid = CFUUIDCreate(NULL);
CFStringRef str = CFUUIDCreateString(NULL, uuid);
CFRelease(uuid);
printf("%s\n", [(NSString*)str UTF8String]);
CFRelease(str);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment