我使用此代码在Mac OS上获取UUID
NSString* getComputerId()
{
io_registry_entry_t ioRegistryRoot = IORegistryEntryFromPath(kIOMasterPortDefault, "IOService:/");
CFStringRef uuidCf = (CFStringRef) IORegistryEntryCreateCFProperty(ioRegistryRoot, CFSTR(kIOPlatformUUIDKey), kCFAllocatorDefault, 0);
IOObjectRelease(ioRegistryRoot);
return (NSString*) uuidCf;
}
这个UUID是否依赖于硬盘?如果用户更换硬盘,UUID会改变吗?