Mac OS App不会运行

时间:2012-09-09 14:02:57

标签: compiler-construction loading

您好我正在尝试构建一个简单的Web浏览器,当我尝试在xcode构建器中运行该程序时,它表示构建已成功,然后通过错误并停止加载

错误:

argv    char ** 0x00007fff5fbff7b8
*argv   char *  0x00007fff5fbff940
**argv  char    '/(My Directory>>>>)'

输出:

2012-09-09 09:59:52.917 Snow Storm[29121:403] An uncaught exception was raised
2012-09-09 09:59:52.919 Snow Storm[29121:403] *** -[NSKeyedUnarchiver decodeObjectForKey:]: cannot decode object of class (WebView)
2012-09-09 09:59:52.924 Snow Storm[29121:403] (
    0   CoreFoundation                      0x00007fff85f6ef56 __exceptionPreprocess + 198
    1   libobjc.A.dylib                     0x00007fff8cb2bd5e objc_exception_throw + 43
    2   CoreFoundation                      0x00007fff85f6ed8a +[NSException raise:format:arguments:] + 106
    3   CoreFoundation                      0x00007fff85f6ed14 +[NSException raise:format:] + 116
    4   Foundation                          0x00007fff8d8bb705 _decodeObjectBinary + 2714
    5   Foundation                          0x00007fff8d8bc976 -[NSKeyedUnarchiver _decodeArrayOfObjectsForKey:] + 1193
    6   Foundation                          0x00007fff8d89345c -[NSArray(NSArray) initWithCoder:] + 486
    7   Foundation                          0x00007fff8d8bb797 _decodeObjectBinary + 2860
    8   Foundation                          0x00007fff8d8baab2 _decodeObject + 201
    9   AppKit                              0x00007fff8365cee6 -[NSView initWithCoder:] + 1051
    10  Foundation                          0x00007fff8d8bb797 _decodeObjectBinary + 2860
    11  Foundation                          0x00007fff8d8baab2 _decodeObject + 201
    12  AppKit                              0x00007fff8374dd1a -[NSWindowTemplate initWithCoder:] + 3998
    13  Foundation                          0x00007fff8d8bb797 _decodeObjectBinary + 2860
    14  Foundation                          0x00007fff8d8bc976 -[NSKeyedUnarchiver _decodeArrayOfObjectsForKey:] + 1193
    15  Foundation                          0x00007fff8d8bc377 -[NSSet(NSSet) initWithCoder:] + 519
    16  Foundation                          0x00007fff8d8bb797 _decodeObjectBinary + 2860
    17  Foundation                          0x00007fff8d8baab2 _decodeObject + 201
    18  AppKit                              0x00007fff83561871 -[NSIBObjectData initWithCoder:] + 2099
    19  Foundation                          0x00007fff8d8bb797 _decodeObjectBinary + 2860
    20  Foundation                          0x00007fff8d8baab2 _decodeObject + 201
    21  AppKit                              0x00007fff83560f1c loadNib + 235
    22  AppKit                              0x00007fff83560470 +[NSBundle(NSNibLoading) _loadNibFile:nameTable:withZone:ownerBundle:] + 217
    23  AppKit                              0x00007fff8356038b +[NSBundle(NSNibLoading) loadNibFile:externalNameTable:withZone:] + 141
    24  AppKit                              0x00007fff835602ce +[NSBundle(NSNibLoading) loadNibNamed:owner:] + 364
    25  AppKit                              0x00007fff837d106f NSApplicationMain + 398
    26  Snow Storm                          0x0000000100001472 main + 34
    27  Snow Storm                          0x0000000100001444 start + 52
)
2012-09-09 09:59:53.026 Snow Storm[29121:403] *** Terminating app due to uncaught exception 'NSInvalidUnarchiveOperationException', reason: '*** -[NSKeyedUnarchiver decodeObjectForKey:]: cannot decode object of class (WebView)'
*** First throw call stack:
(
    0   CoreFoundation                      0x00007fff85f6ef56 __exceptionPreprocess + 198
    1   libobjc.A.dylib                     0x00007fff8cb2bd5e objc_exception_throw + 43
    2   CoreFoundation                      0x00007fff85f6ed8a +[NSException raise:format:arguments:] + 106
    3   CoreFoundation                      0x00007fff85f6ed14 +[NSException raise:format:] + 116
    4   Foundation                          0x00007fff8d8bb705 _decodeObjectBinary + 2714
    5   Foundation                          0x00007fff8d8bc976 -[NSKeyedUnarchiver _decodeArrayOfObjectsForKey:] + 1193
    6   Foundation                          0x00007fff8d89345c -[NSArray(NSArray) initWithCoder:] + 486
    7   Foundation                          0x00007fff8d8bb797 _decodeObjectBinary + 2860
    8   Foundation                          0x00007fff8d8baab2 _decodeObject + 201
    9   AppKit                              0x00007fff8365cee6 -[NSView initWithCoder:] + 1051
    10  Foundation                          0x00007fff8d8bb797 _decodeObjectBinary + 2860
    11  Foundation                          0x00007fff8d8baab2 _decodeObject + 201
    12  AppKit                              0x00007fff8374dd1a -[NSWindowTemplate initWithCoder:] + 3998
    13  Foundation                          0x00007fff8d8bb797 _decodeObjectBinary + 2860
    14  Foundation                          0x00007fff8d8bc976 -[NSKeyedUnarchiver _decodeArrayOfObjectsForKey:] + 1193
    15  Foundation                          0x00007fff8d8bc377 -[NSSet(NSSet) initWithCoder:] + 519
    16  Foundation                          0x00007fff8d8bb797 _decodeObjectBinary + 2860
    17  Foundation                          0x00007fff8d8baab2 _decodeObject + 201
    18  AppKit                              0x00007fff83561871 -[NSIBObjectData initWithCoder:] + 2099
    19  Foundation                          0x00007fff8d8bb797 _decodeObjectBinary + 2860
    20  Foundation                          0x00007fff8d8baab2 _decodeObject + 201
    21  AppKit                              0x00007fff83560f1c loadNib + 235
    22  AppKit                              0x00007fff83560470 +[NSBundle(NSNibLoading) _loadNibFile:nameTable:withZone:ownerBundle:] + 217
    23  AppKit                              0x00007fff8356038b +[NSBundle(NSNibLoading) loadNibFile:externalNameTable:withZone:] + 141
    24  AppKit                              0x00007fff835602ce +[NSBundle(NSNibLoading) loadNibNamed:owner:] + 364
    25  AppKit                              0x00007fff837d106f NSApplicationMain + 398
    26  Snow Storm                          0x0000000100001472 main + 34
    27  Snow Storm                          0x0000000100001444 start + 52
)
terminate called throwing an exception(lldb) 

这是指它所指的:

int main(int argc, char *argv[])
{
    return NSApplicationMain(argc, (const char **)argv);
}

希望有人可以提供帮助

丹佛

1 个答案:

答案 0 :(得分:37)

您应该将WebKit.framework添加到您的项目中。