//Create unique ID CFUUIDRef newUniqueId = CFUUIDCreate(kCFAllocatorDefault); CFStringRef newUniqueIdString = CFUUIDCreateString(kCFAllocatorDefault, newUniqueId); MyString = [MyString stringByAppendingPathComponent:(NSString *)newUniqueIdString]; CFRelease(newUniqueId); CFRelease(newUniqueIdString);
Category: Random
Random General
There is not a class in Objective-C with a method for generating random numbers but C may be used. E.g: rand(), srand(), random(), srandom() and arc4random(). arc4random() tends to be preferred as it does not require seeding (it automatically initializes itself). Examples: int RandomNumber = arc4random() % 3; //Get random number from 0 – 2 […]