Skip to content

Instantly share code, notes, and snippets.

@maxhuk
Created April 9, 2013 09:23
Show Gist options
  • Save maxhuk/5344306 to your computer and use it in GitHub Desktop.
Save maxhuk/5344306 to your computer and use it in GitHub Desktop.
UUID string generator.
//
// UUID.h
//
// Created by Maksym Huk on 3/20/13.
// Copyright (c) 2013 Maksym Huk. All rights reserved.
//
#import <Foundation/Foundation.h>
extern NSString *GenerateUUID();
//
// UUID.h
//
// Created by Maksym Huk on 3/20/13.
// Copyright (c) 2013 Maksym Huk. All rights reserved.
//
#import <Foundation/Foundation.h>
NSString *GenerateUUID()
{
CFUUIDRef newUniqueId = CFUUIDCreate(kCFAllocatorDefault);
NSString * uuidString = (__bridge_transfer NSString*)CFUUIDCreateString(kCFAllocatorDefault, newUniqueId);
CFRelease(newUniqueId);
return uuidString;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment