Skip to content

Instantly share code, notes, and snippets.

@atnan
Created December 10, 2009 01:46
Show Gist options
  • Save atnan/253035 to your computer and use it in GitHub Desktop.
Save atnan/253035 to your computer and use it in GitHub Desktop.
- (NSString*)stringWithDeviceToken:(NSData*)deviceToken {
const char* data = [deviceToken bytes];
NSMutableString* token = [NSMutableString string];
for (int i = 0; i < [deviceToken length]; i++) {
[token appendFormat:@"%02.2hhX", data[i]];
}
return [[token copy] autorelease];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment