[NSKeyedUnarchiver decodeObjectForKey:]: cannot decode object of class (IBCIImage)

徘徊边缘 提交于 2019-12-11 23:26:57

问题


After changing location of some UI elements(NSButton) in xib (Xcode 5). I am getting following exception on console (10.6 and above) but view is loaded properly.

-[NSCoder(CACoderAdditions) CA_decodeObjectForKey:]: ignoring exception *** -[NSKeyedUnarchiver decodeObjectForKey:]: cannot decode object of class (IBCIImage)  

and crash on OSX 10.5

Application Specific Information:
*** Terminating app due to uncaught exception 'NSInvalidUnarchiveOperationException', reason: '*** -[NSKeyedUnarchiver decodeObjectForKey:]: cannot decode object of class (IBCIImage)'

Thread 0 Crashed:
0   com.apple.CoreFoundation        0x91389e94 ___TERMINATING_DUE_TO_UNCAUGHT_EXCEPTION___ + 4
1   libobjc.A.dylib                 0x931f4e3b objc_exception_throw + 40
2   com.apple.CoreFoundation        0x91389dcb +[NSException raise:format:arguments:] + 155
3   com.apple.CoreFoundation        0x91389e0a +[NSException raise:format:] + 58
4   com.apple.Foundation            0x90c0d14f _decodeObjectBinary + 2975
5   com.apple.Foundation            0x90c0c515 _decodeObject + 229
6   com.apple.QuartzCore            0x95c135d2 -[CIFilter initWithCoder:] + 316
7   com.apple.Foundation            0x90c0cba0 _decodeObjectBinary + 1520
8   com.apple.Foundation            0x90c0c515 _decodeObject + 229
9   com.apple.QuartzCore            0x95d24260 -[NSCoder(CACoderAdditions) CA_decodeObjectForKey:] + 42
10  com.apple.QuartzCore            0x95d34ff0 CAObject_initWithCoder + 197
11  com.apple.Foundation            0x90c0cba0 _decodeObjectBinary + 1520
12  com.apple.Foundation            0x90c0e62d -[NSKeyedUnarchiver _decodeArrayOfObjectsForKey:] + 1437
13  com.apple.Foundation            0x90c2f03a -[NSDictionary(NSDictionary) initWithCoder:] + 602
14  com.apple.Foundation            0x90c0cba0 _decodeObjectBinary + 1520
15  com.apple.Foundation            0x90c0c515 _decodeObject + 229
16  com.apple.AppKit                0x92145c7c -[NSView initWithCoder:] + 1417
17  com.apple.AppKit                0x9217e3d8 -[NSControl initWithCoder:] + 58
18  com.apple.AppKit                0x92185b4d -[NSImageView initWithCoder:] + 725
19  com.apple.Foundation            0x90c0cba0 _decodeObjectBinary + 1520
20  com.apple.Foundation            0x90c0e62d -[NSKeyedUnarchiver _decodeArrayOfObjectsForKey:] + 1437
21  com.apple.Foundation            0x90c0eaa9 -[NSArray(NSArray) initWithCoder:] + 425
22  com.apple.Foundation            0x90c0cba0 _decodeObjectBinary + 1520
23  com.apple.Foundation            0x90c0c515 _decodeObject + 229
24  com.apple.AppKit                0x92145825 -[NSView initWithCoder:] + 306
25  com.apple.AppKit                0x92146cd8 -[NSCustomView initWithCoder:] + 695
26  com.apple.Foundation            0x90c0cba0 _decodeObjectBinary + 1520
27  com.apple.Foundation            0x90c0c515 _decodeObject + 229
28  com.apple.AppKit                0x921469b4 -[NSResponder initWithCoder:] + 85
29  com.apple.AppKit                0x9214574a -[NSView initWithCoder:] + 87
30  com.apple.AppKit                0x92182813 -[NSProgressIndicator initWithCoder:] + 58
31  com.apple.Foundation            0x90c0cba0 _decodeObjectBinary + 1520
32  com.apple.Foundation            0x90c0c515 _decodeObject + 229
33  com.apple.AppKit                0x9213fb1e -[NSNibConnector initWithCoder:] + 435
34  com.apple.AppKit                0x921445ef -[NSNibOutletConnector initWithCoder:] + 378
35  com.apple.Foundation            0x90c0cba0 _decodeObjectBinary + 1520
36  com.apple.Foundation            0x90c0e62d -[NSKeyedUnarchiver _decodeArrayOfObjectsForKey:] + 1437
37  com.apple.Foundation            0x90c0eaa9 -[NSArray(NSArray) initWithCoder:] + 425
38  com.apple.Foundation            0x90c0cba0 _decodeObjectBinary + 1520
39  com.apple.Foundation            0x90c0c515 _decodeObject + 229
40  com.apple.AppKit                0x9213e976 -[NSIBObjectData initWithCoder:] + 2308
41  com.apple.Foundation            0x90c0cba0 _decodeObjectBinary + 1520
42  com.apple.Foundation            0x90c0c515 _decodeObject + 229
43  com.apple.AppKit                0x9225c597 -[NSNib instantiateNibWithExternalNameTable:] + 750
44  com.apple.AppKit                0x9225c272 -[NSNib instantiateNibWithOwner:topLevelObjects:] + 277
45  com.apple.AppKit                0x9241af3b -[NSViewController loadView] + 243
46  com.apple.AppKit                0x9241ae1b -[NSViewController view] + 46

old xib :

<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10">
    <data>

After changing button location in Xcode Version 5.0 (5A1412) (New Xib) :

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="4510" systemVersion="13A603" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
    <dependencies>
        <deployment version="1050" defaultVersion="1050" identifier="macosx"/>
        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="4510"/>
    </dependencies>
    <objects>
some data..

<animations>
                        <caTransition key="subviews">
                            <mutableData key="keyedArchiveRepresentation">
some_data

Can anyone please help me out.

来源:https://stackoverflow.com/questions/20113863/nskeyedunarchiver-decodeobjectforkey-cannot-decode-object-of-class-ibciimag

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!