【发布时间】:2018-11-14 13:03:32
【问题描述】:
我在 iOS 12.0.1 上出现以下日志崩溃:
ImageIO: CFDataGetBytes: data: 0x28539b2f0 size: 154262 offset: 8 count: 8 dst: 0x16dbf86f0
External data reference cant find underlying file.
Fatal Exception: NSInternalInconsistencyException
0 CoreFoundation 0x23c2d7ef8 __exceptionPreprocess
1 libobjc.A.dylib 0x23b4a5a40 objc_exception_throw
2 CoreData 0x23efd5fc8 -[_PFExternalReferenceData getBytes:range:]
3 ImageIO 0x23e6c7178 IIOImageRead::getCFDataBytesAtOffset(void*, unsigned long, unsigned long)
4 ImageIO 0x23e6c6c38 IIOImageRead::getBytesAtOffset(void*, unsigned long, unsigned long)
5 ImageIO 0x23e711aa4 IIO_Reader_PNG::getImageCount(IIOImageReadSession*, IIODictionary*, int*, unsigned int*)
6 ImageIO 0x23e54c5d8 IIO_Reader::callGetImageCount(CGImageReadSession*, IIODictionary*, int*)
7 ImageIO 0x23e532194 IIOImageSource::updatedCount()
8 ImageIO 0x23e5367b4 CGImageSourceGetCount
9 UIKitCore 0x26960c1a4 _UIImageRefFromData
10 UIKitCore 0x268d4e15c -[UIImage(UIImagePrivate) _initWithData:preserveScale:cache:]
11 UIKitCore 0x268d48b7c +[UIImage imageWithData:]
12 MyApp 0x102239570 __48-[InfoPreviewController bindToPatient:]_block_invoke_2 (InfoPreviewController.m:83)
13 ReactiveObjC 0x1031f8004 -[RACSubscriber sendNext:] (RACSubscriber.m:72)
似乎核心数据有图像,但是当它试图检索它时,它失败了。
在这种情况下如何验证数据完整性? 我想以用户友好的方式处理此故障,而不是让应用程序崩溃。
【问题讨论】:
标签: ios objective-c core-data