ios中获取一个唯一的字符串(利用UUID)

- (NSString *)getUniqueStrByUUID {
    CFUUIDRef uuidRef = CFUUIDCreate(NULL);
    CFStringRef uuidStrRef= CFUUIDCreateString(NULL, uuidRef);
    CFRelease(uuidRef);
    NSString *retStr = [NSString stringWithString:(NSString *)uuidStrRef];
    CFRelease(uuidStrRef);
    return retStr;
}

你可能感兴趣的:(ios中获取一个唯一的字符串(利用UUID))