尝试设置图像数据

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/

10-11 14:34