Format specifier %@ (in stringWithFormat), by definition, uses the "description" method on the object to get the text to insert, so both of your techniques are basically the same.
Using "description" for getting your token as a string was *always* the wrong thing to do. There is no rule about how objects must format their descriptions, and the descriptions are subject to change at any time (as you've seen).
What you should actually do is convert the data byte by byte to hexadecimal characters, and concatenate those into a single string. I don't think there's any Objective-C API for this, so you'll have to write the code yourself, or search GitHub (or elsewhere) for code that does it.
What you should actually do is convert the data byte by byte to hexadecimal characters, and concatenate those into a single string.
Alternatively, you could use Base64, which is supported by
NSDataand widely supported on the server side.
Share and Enjoy
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"
1) why can't you send the NSData object to your server?
2) try (I am not sure what 'encoding' will work 'correctly' - but just convert back to NSData using that same encoding)
NSString *theTokenString=[[NSString alloc] initWithBytes:[theToken bytes] length:[theToken length] encoding:NSUTF8StringEncoding];