随机生成UUID(GUID)的方法

- (NSString *)UUID
{
    CFUUIDRef uuid_ref = CFUUIDCreate(NULL);
    
    CFStringRef uuid_string_ref= CFUUIDCreateString(NULL, uuid_ref);
    
    CFRelease(uuid_ref);
    
    NSString *uuid = [NSString stringWithFormat:@"%@",uuid_string_ref];
    
    CFRelease(uuid_string_ref);
    return uuid;
}

 

posted on 2015-02-11 15:11  狭义  阅读(947)  评论(0编辑  收藏  举报

导航