UDID is deprecated, and it's use is no longer allowed, you must use UUID.
It has drawbacks and benefits compared with UDID.
- (NSString *)uuidString {
// Returns a UUID
CFUUIDRef uuid = CFUUIDCreate(kCFAllocatorDefault);
NSString *uuidStr = (__bridge_transfer NSString *)CFUUIDCreateString(kCFAllocatorDefault, uuid);
return uuidStr;
}
- UDID always returned a unique and consistent ID. UUID whilst unique will return different every time. You need to store in user defaults or whereever and only generate if it's not already there.