【发布时间】:2012-03-23 09:14:08
【问题描述】:
我尝试使用 UIImages 对数组进行编码。
然后我调用“保存”函数
NSString *filePath = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0] stringByAppendingPathComponent:@"SavedUserData"];
[NSKeyedArchiver archiveRootObject: self toFile:filePath];
我得到了行的异常[encoder encodeObject:recipePhotoList forKey:@"recipePhotoList"]; //带有图像的数组
-[UIImage encodeWithCoder:]: unrecognized selector sent to instance 0x1b1380
2012-03-23 11:59:43.694 fishmarket[261:1a0f] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIImage encodeWithCoder:]: unrecognized selector sent to instance 0x1b1380'
在 5+ iOS 上它运行良好,在 4.3 上我有这个问题。
【问题讨论】:
标签: objective-c encode