iOS生成一个32位的UUID

- (NSString *)uuidString

{

    CFUUIDRef uuid_ref = CFUUIDCreate(NULL);

    CFStringRef uuid_string_ref= CFUUIDCreateString(NULL, uuid_ref);

    NSString *uuid = [NSString stringWithString:(__bridge NSString *)uuid_string_ref];

    CFRelease(uuid_ref);

    CFRelease(uuid_string_ref);

    return [uuid lowercaseString];

}

 

posted @ 2016-06-21 09:25  柳仙慧子  阅读(3556)  评论(0编辑  收藏  举报