//内连,使用情况较多下使用,
static inline NSString * GetUUIDString()
{
CFUUIDRef uuidObj = CFUUIDCreate(nil);
NSString *uuidString = (__bridge_transfer NSString*)CFUUIDCreateString(nil, uuidObj);
CFRelease(uuidObj);
return uuidString;
}
//类方法,建议新建NSString的分类使用,
+ (NSString*) getUUIDString
{
CFUUIDRef uuidObj = CFUUIDCreate(nil);
NSString *uuidString = (__bridge_transfer NSString*)CFUUIDCreateString(nil, uuidObj);
CFRelease(uuidObj);
return uuidString;
}
原文地址:http://blog.csdn.net/shouqiangwei/article/details/42239765