- (NSString *)createUUID
{
// Create universally unique identifier (object)
CFUUIDRef uuidObject = CFUUIDCreate(kCFAllocatorDefault);
// Get the string representation of CFUUID object.
NSString *uuidStr = [(NSString *)CFUUIDCreateString(kCFAllocatorDefault, uuidObject) autorelease];
// If needed, here is how to get a representation in bytes, returned as a structure
// typedef struct {
// UInt8 byte0;
// UInt8 byte1;
// ...
// UInt8 byte15;
// } CFUUIDBytes;
//CFUUIDBytes bytes = CFUUIDGetUUIDBytes(uuidObject);
CFRelease(uuidObject);
return uuidStr;
}
————————————————
版权声明:本文为CSDN博主「niejeff」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/jianwuhennie/article/details/9419903
oc获取设备uuid
最新推荐文章于 2024-04-30 23:37:55 发布