I am using NSUUID
for unique ids in my app like so:
[[NSUUID UUID] UUIDString]
and as is the expected result I get an id like this one: 102A21AD-7216-4517-8A79-39776B767E72
For backend reasons I need the letters in the uuid to be lowercase. I tried to call
[[NSUUID UUID] UUIDString].lowercaseString
but the returned string is empty.
Do I really have to iterate over all of the characters in the string and convert the appropriate ones to lowercase? If so does anyone have any advice of the most efficient way to do this?
EDIT:
The way I was trying to implement this was by subclassing NSUUID and then overriding the
-(NSString*) UUIDString;
method.
My implementation of this was
-(NSString*) UUIDString{
return [super UUIDString].lowercaseString;
}
The accepted answer explains why this doesn't work.