假设我使用32位保存此NSData
,但现在我的用户正在迁移并使用64位。
当我从我的文件中取回NSData
并再次读取时,它读错了,因为字节不同。任何帮助将不胜感激:
-(IBAction) generate{
NSData *data = [[File sharedFile] getObject:@"token"];
unsigned char *ch = (unsigned char*)[data bytes]; // I think this is went wrong, when the bytes now is different.
Token *d;
d = d->resurrect(ch); // this read differently if the unsigned char is different size
NSString* token = [NSString stringWithFormat:@"%s",d->generateToken()];
}
的更新
resurrect()是静态库方法,
static Device* resurrect(unsigned char* bdev);