随机生成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;

}

 

你可能感兴趣的:(uuid)