rowwingman rowwingman -4 years ago 417
Objective-C Question

How to convert NSUUID to NSData

I need to get

NSData
from
vendorIdentifier
without converting to
NSString
, clear bytes.
How to convert
NSUUID
using
getUUIDBytes:
to
NSData
?

Answer Source
NSUUID *vendorIdentifier = [[UIDevice currentDevice] identifierForVendor];
uuid_t uuid;
[vendorIdentifier getUUIDBytes:uuid];

NSData *vendorData = [NSData dataWithBytes:uuid length:16];
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download