It is sometimes useful to get a hexadecimal string representation of the contents of NSData just the way they are stored in memory.
This is the case, for example, when you want to communicate to your backend service the value of the push token assigned to your device by
Apple’s Push Notifications Services.
If your push token is stored in memory as 0xDEADBEEF, then the string “deadbeef” is exactly what you
want to send to your backend service.
This is simply done as follows:
If you are looking instead for how to make a string out of NSData, that is simply done by using the correct NSString initializer.