views:

682

answers:

2

(subj)

Thanks.

+2  A: 

Solved.

@implementation UIDevice (ChangeUID)

  • (NSString*)uniqueIdentifier { return @"test"; }

@end

Newbee
Dangerous, but interesting.
Alasdair Allan
A: 

If you just want to generate an UUID, say to tag an upload or communication to your server as being from a specific device you can use the CFUUID class to generate a UUID the first time your application is run,

NSString *uuid = nil;
CFUUID theUUID = CFUUIDCreate(kCFAllocatorDefault);
if (theUUID) {
  uuid = NSMakeCollectable(CFUUIDCreateString(kCFAllocatorDefault, theUUID);
  CFRelease(theUUID);
}

and then save this in your application preferences. This will then uniquely identify the users device, and it'll also work in the iPhone simulator.

Alasdair Allan