尝试设置图像数据
NSData *thumbnailData = UIImageJPEGRepresentation(place.thumbnail, 0.8);
[placeDict setObject:thumbnailData forKey:thumbnail];
并出现错误:
Could not messagepack object: External Data Reference: <self = 0xbba24f0 ; path = nil ; length = 557>
最佳答案
您确定在这行代码之后收到此错误吗? 使用此代码可以确定您的程序在这部分代码中是否有错误:
NSLog((@"%s [Line %d] "), __PRETTY_FUNCTION__, __LINE__);
NSData *thumbnailData = UIImageJPEGRepresentation(place.thumbnail, 0.8);
NSLog((@"%s [Line %d] "), __PRETTY_FUNCTION__, __LINE__);
placeDict setObject:thumbnailData forKey:thumbnail];
NSLog((@"%s [Line %d] "), __PRETTY_FUNCTION__, __LINE__);
关于objective-c - MsgPack 无法消息打包 NSData 对象,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13818955/