Objective c 线程1:信号信号SIGABRT有人能帮我吗?
运行应用程序后,我在AppDelegate.h中收到此错误消息。“线程1:信号SIGABRT”我已经在代码的一侧注释了错误发生的位置。有人能帮忙吗。谢谢Objective c 线程1:信号信号SIGABRT有人能帮我吗?,objective-c,xcode,xcode5,appdelegate,sigabrt,Objective C,Xcode,Xcode5,Appdelegate,Sigabrt,运行应用程序后,我在AppDelegate.h中收到此错误消息。“线程1:信号SIGABRT”我已经在代码的一侧注释了错误发生的位置。有人能帮忙吗。谢谢 #import <UIKit/UIKit.h> #import "AppDelegate.h" int main(int argc, char * argv[]) { @autoreleasepool { return UIApplicationMain(argc, argv, nil, NSString
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
int main(int argc, char * argv[])
{
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); //Thread 1: signal SIGABRT
}
}
#导入
#导入“AppDelegate.h”
int main(int argc,char*argv[])
{
@自动释放池{
返回UIApplicationMain(argc、argv、nil、NSStringFromClass([AppDelegate class]);//线程1:信号SIGABRT
}
}
这是我得到的堆栈跟踪:
2014-03-29 17:27:56.440 Game[3599:70b] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIApplication 0x109c28520> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key view.'
*** First throw call stack:
(
0 CoreFoundation 0x0000000101c1b795 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000101725991 objc_exception_throw + 43
2 CoreFoundation 0x0000000101c9fe69 -[NSException raise] + 9
3 Foundation 0x000000010130703a -[NSObject(NSKeyValueCoding) setValue:forKey:] + 259
4 CoreFoundation 0x0000000101c17700 -[NSArray makeObjectsPerformSelector:] + 224
5 UIKit 0x00000001005d11b8 -[UINib instantiateWithOwner:options:] + 1131
6 UIKit 0x00000001005d2bb2 -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 138
7 UIKit 0x000000010038781d -[UIApplication _loadMainNibFileNamed:bundle:] + 42
8 UIKit 0x0000000100386b1a -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 454
9 UIKit 0x0000000100397aab -[UIApplication handleEvent:withNewEvent:] + 3092
10 UIKit 0x0000000100397f1e -[UIApplication sendEvent:] + 79
11 UIKit 0x00000001003882be _UIApplicationHandleEvent + 618
12 GraphicsServices 0x0000000104977bb6 _PurpleEventCallback + 762
13 GraphicsServices 0x000000010497767d PurpleEventCallback + 35
14 CoreFoundation 0x0000000101b9d819 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 41
15 CoreFoundation 0x0000000101b9d5ee __CFRunLoopDoSource1 + 478
16 CoreFoundation 0x0000000101bc6ab3 __CFRunLoopRun + 1939
17 CoreFoundation 0x0000000101bc5f33 CFRunLoopRunSpecific + 467
18 UIKit 0x00000001003864bd -[UIApplication _run] + 609
19 UIKit 0x0000000100388043 UIApplicationMain + 1010
20 Game 0x0000000100000f33 main + 115
21 libdyld.dylib 0x00000001032755fd start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
2014-03-29 17:27:56.440游戏[3599:70b]***由于未捕获的异常“NSUnknownKeyException”而终止应用程序,原因:“[setValue:forUndefinedKey:]:此类不符合密钥视图的密钥值编码。”
***第一次抛出调用堆栈:
(
0 CoreFoundation 0x0000000101c1b795例外预处理+165
1 libobjc.A.dylib 0x0000000101725991 objc_异常_抛出+43
2 CoreFoundation 0x0000000101c9fe69-[N异常上升]+9
3基金会0x000 000 010130703A- [ NSObjices(NSKEY ValueCoDIN)SETValue:FordK::] + 259
4 CoreFoundation 0x0000000101c17700-[NSArray makeObjectsPerformSelector:+224
5 UIKit 0x00000001005d11b8-[UINib实例化所有者:选项:][1131
6 UIKit 0x00000001005d2bb2-[NSBundle(UINSBUNDLEADTIONS)LOADNIBNAME:所有者:选项:][138
7 UIKit 0x000000010038781d-[UIApplication\u LoadMainNibFileName:bundle:][42
8 UIKit 0x0000000100386b1a-[UIApplication\u运行时URL:payload:launchOrientation:statusBarStyle:statusBarHidden:+454
9 UIKit 0x0000000100397aab-[UIApplication handleEvent:withNewEvent:][3092
10 UIKit 0x0000000100397f1e-[UIApplication sendEvent:][79
11 UIKit 0x00000001003882be _UIApplicationHandleEvent+618
12图形服务0x0000000104977bb6_PurpleEventCallback+762
13图形服务0x000000010497767d PurpleEventCallback+35
14 CoreFoundation 0x0000000101b9d819运行循环正在调用源1执行功能
15 CoreFoundation 0x0000000101b9d5ee__CFRunLoopDoSource1+478
16 CoreFoundation 0x0000000101bc6ab3\uu CFRunLoopRun+1939
17 CoreFoundation 0x0000000101bc5f33 CFRunLoopRunSpecific+467
18 UIKit 0x00000001003864bd-[UIU应用程序运行]+609
19 UIKit 0x0000000100388043 UIApplicationMain+1010
20游戏0x0000000100000f33主+115
21 libdyld.dylib 0x00000001032755fd start+1
)
libc++abi.dylib:以NSException类型的未捕获异常终止
Game[3599:70b]***由于未捕获的异常“NSUnknownKeyException”而终止应用程序,原因:“[setValue:forUndefinedKey:]:此类不符合密钥视图的密钥值编码。”
上面的行表示您正在尝试访问名为view的属性,但您的类没有该名称的属性。您正在对实际上没有视图的对象调用view属性(但编译器很可能会捕捉到),或者尚未在Interface Builder中为视图控制器设置视图出口
检查您在应用程序代理中加载的视图控制器是否在IB中连接了视图出口。添加异常断点,这可能会为您提供更多错误实际发生位置的指示。看看xcode屏幕左侧的调用堆栈,这也会给你一个更好的提示。这是这个问题的后续问题吗?如果是这样的话,你能把你贴在这里的堆栈跟踪贴在这里吗?我不知道堆栈跟踪是什么。是的,这是后续行动。很抱歉,我是xcode新手,我已经尝试过研究所有问题,但仍然没有找到解决方案。另外,我还有一个问题要解决,那就是如何将XIB中的按钮链接到故事板中的viewcontroller。没问题,我将编辑这些问题,然后链接到这个问题。至于你的下一个问题,请为这个问题创建另一个问题(就像你对这个问题所做的那样)。实际上,根据错误消息,它不是类
游戏
,而是类UIApplication
。游戏似乎是应用程序名。
Game[3599:70b] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIApplication 0x109c28520> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key view.'