Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone UIImage编码器,带编码器或识别选择器?_Iphone_Objective C_Uitableview_Ios4_Core Data - Fatal编程技术网

Iphone UIImage编码器,带编码器或识别选择器?

Iphone UIImage编码器,带编码器或识别选择器?,iphone,objective-c,uitableview,ios4,core-data,Iphone,Objective C,Uitableview,Ios4,Core Data,我得到这个错误,我不知道如何修复它。我刚刚添加了来自Apple示例(LazyTableImages)的延迟加载,并结合了来自Photo Locations示例项目的UIImageToDataTransformer类 2011-07-08 -[UIImage encodeWithCoder:]: unrecognized selector sent to instance 0x73af2e0 2011-07-08 *** Terminating app due to uncaught except

我得到这个错误,我不知道如何修复它。我刚刚添加了来自Apple示例(LazyTableImages)的延迟加载,并结合了来自Photo Locations示例项目的UIImageToDataTransformer类

2011-07-08 -[UIImage encodeWithCoder:]: unrecognized selector sent to instance 0x73af2e0
2011-07-08 *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIImage encodeWithCoder:]: unrecognized selector sent to instance 0x73af2e0'
*** Call stack at first throw:
(
    0   CoreFoundation                      0x02e65919 __exceptionPreprocess + 185
    1   libobjc.A.dylib                     0x02fb35de objc_exception_throw + 47
    2   CoreFoundation                      0x02e6742b -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
    3   CoreFoundation                      0x02dd7116 ___forwarding___ + 966
    4   CoreFoundation                      0x02dd6cd2 _CF_forwarding_prep_0 + 50
    5   Foundation                          0x02b46076 _encodeObject + 1076
    6   Foundation                          0x02b51495 +[NSKeyedArchiver archivedDataWithRootObject:] + 206
    7   CoreData                            0x0098e0f5 -[NSSQLiteConnection execute] + 2677
    8   CoreData                            0x009e00d2 -[NSSQLiteConnection updateRow:] + 354
    9   CoreData                            0x009df084 -[NSSQLConnection performAdapterOperations:] + 180
    10  CoreData                            0x009ded7e -[NSSQLCore _performChangesWithAdapterOps:] + 494
    11  CoreData                            0x009dd876 -[NSSQLCore performChanges] + 406
    12  CoreData                            0x009d7338 -[NSSQLCore saveChanges:] + 216
    13  CoreData                            0x00995539 -[NSSQLCore executeRequest:withContext:error:] + 409
    14  CoreData                            0x00a4411b -[NSPersistentStoreCoordinator executeRequest:withContext:error:] + 3691
    15  CoreData                            0x009cdc48 -[NSManagedObjectContext save:] + 712
    16  Playing                             0x0004b99d -[TheData saveEvent] + 93
    17  Playing                             0x00048097 -[TheData updateEvent:] + 1527
    18  Playing                             0x00047943 -[TheData runUpdateWithData:] + 659
    19  CoreFoundation                      0x02dd642d __invoking___ + 29
    20  CoreFoundation                      0x02dd6301 -[NSInvocation invoke] + 145
    21  Foundation                          0x02ba19a5 -[NSInvocationOperation main] + 51
    22  Foundation                          0x02b100c6 -[__NSOperationInternal start] + 747
    23  Foundation                          0x02b0fd1a ____startOperations_block_invoke_2 + 106
    24  libSystem.B.dylib                   0x924f1fc4 _dispatch_call_block_and_release + 16
    25  libSystem.B.dylib                   0x924e4292 _dispatch_worker_thread2 + 228
    26  libSystem.B.dylib                   0x924e3d21 _pthread_wqthread + 390
    27  libSystem.B.dylib                   0x924e3b66 start_wqthread + 30
)
terminate called after throwing an instance of 'NSException'
sharedlibrary apply-load-rules all
Current language:  auto; currently objective-c

UIImage
不符合
NSCoding
协议,并且(因此)没有实现
encodeWithCoder:
。您可能希望将图像转换为数据表示形式(例如PNG数据),并对其进行编码


编辑:另请参见解决方法。

从iOS 5开始,UIImage确实符合NSCoding。。。然而,我一直在努力寻找一种适用于iOS 4和iOS 5的解决方案。