Tuesday, November 23, 2010

Push Notification:iPhone deviceToken convert to NSString

Here's how to convert the (NSData *)deviceToken to (NSString *):
NSString *deviceTokenString = [[deviceToken description] stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"<>"]];
// also remove the space
deviceTokenString = [deviceTokenString stringByReplacingOccurrencesOfString:@" " withString:@""];

No comments:

Post a Comment