3
设备标记第一次可能为空吗?我已经从 设备令牌中删除了空白区,但它仍然会在数据库中显示为空。关于设备标记
deviceTokenStr =[[[[deviceToken description]
stringByReplacingOccurrencesOfString: @"<" withString: @""]
stringByReplacingOccurrencesOfString: @">" withString: @""]
stringByReplacingOccurrencesOfString: @" " withString: @""];
NSLog(@"device token------------%@",deviceTokenStr);
devicetk=[deviceTokenStr retain];
NSLog(@"My token is: %@", deviceTokenStr);
除调试外,不要使用'description'方法。 Apple不保证它保持不变。使用:'[[NSString alloc] initWithData:deviceToken encoding:NSUTF8StringEncoding]]' – zaph
获取'deviceToken'的代码在哪里?试试NSLog(@“deviceToken:%@”,deviceToken);看见了。 – zaph
设备标记在第一次为空。这意味着你想说它会从第二次返回值? –