我正在实施推送通知。我想将我的APNS令牌另存为字符串。
- (void)application:(UIApplication *)application
didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)newDeviceToken
{
NSString *tokenString = [NSString stringWithUTF8String:[newDeviceToken bytes]]; //[[NSString alloc]initWithData:newDeviceToken encoding:NSUTF8StringEncoding];
NSLog(@"%@", tokenString);
NSLog(@"%@", newDeviceToken);
}
代码的第一行显示为空。第二个打印令牌。如何获取newDeviceToken作为NSString?
NSLog
,在一个打印newDeviceToken
?