2010-10-08 58 views
0

我正在开始一个项目,我有一个导航控制器。我首先加载一个登录页面,然后进入一个登录成功页面,在那里我有几个按钮可以点击,当我点击这里的任何按钮时,我得到这个错误。当我试图调试代码时,我在按钮单击方法中有一个断点,然后在执行任何代码之前,我得到了它。这是日志。任何人都可以帮助我。在此先感谢sigabrt加载笔尖文件时出错

2010-10-07 23:15:28.868 Cattle_try1[14417:207] -[__NSCFType onYardMapBtnClick]: unrecognized selector sent to instance 0x6149a40 
2010-10-07 23:15:28.872 Cattle_try1[14417:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFType onYardMapBtnClick]: unrecognized selector sent to instance 0x6149a40' 
*** Call stack at first throw: 
(
    0 CoreFoundation      0x02655b99 __exceptionPreprocess + 185 
    1 libobjc.A.dylib      0x027a540e objc_exception_throw + 47 
    2 CoreFoundation      0x026576ab -[NSObject(NSObject) doesNotRecognizeSelector:] + 187 
    3 CoreFoundation      0x025c72b6 ___forwarding___ + 966 
    4 CoreFoundation      0x025c6e72 _CF_forwarding_prep_0 + 50 
    5 UIKit        0x002b47f8 -[UIApplication sendAction:to:from:forEvent:] + 119 
    6 UIKit        0x0033fde0 -[UIControl sendAction:to:forEvent:] + 67 
    7 UIKit        0x00342262 -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 527 
    8 UIKit        0x00340e0f -[UIControl touchesEnded:withEvent:] + 458 
    9 UIKit        0x002d83d0 -[UIWindow _sendTouchesForEvent:] + 567 
    10 UIKit        0x002b9cb4 -[UIApplication sendEvent:] + 447 
    11 UIKit        0x002be9bf _UIApplicationHandleEvent + 7672 
    12 GraphicsServices     0x02f35822 PurpleEventCallback + 1550 
    13 CoreFoundation      0x02636ff4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52 
    14 CoreFoundation      0x02597807 __CFRunLoopDoSource1 + 215 
    15 CoreFoundation      0x02594a93 __CFRunLoopRun + 979 
    16 CoreFoundation      0x02594350 CFRunLoopRunSpecific + 208 
    17 CoreFoundation      0x02594271 CFRunLoopRunInMode + 97 
    18 GraphicsServices     0x02f3400c GSEventRunModal + 217 
    19 GraphicsServices     0x02f340d1 GSEventRun + 115 
    20 UIKit        0x002c2af2 UIApplicationMain + 1160 
    21 Cattle_try1       0x00002338 main + 102 
    22 Cattle_try1       0x000022c9 start + 53 
) 
terminate called after throwing an instance of 'NSException' 
Program received signal: “SIGABRT”. 
kill 
quit 

调试器已退出,状态0

回答

1

这不是解决方案,但至少要做一个回溯,看看你是否能够确切地看到它的死亡地点。

构建和调试应用程序并运行应用程序,直到出现错误。然后在控制台(出现SIGABRT错误的地方)键入

bt 

和Return键。如果你很幸运,它会告诉你它失败的地方。您正在寻找最高(最早写入控制台)文件和行号,可能是您的视图控制器之一.m文件。

2

这是非常有可能,你是不是保留您试图访问的对象。但是如果你不包含代码,很难说清楚。

+0

请确保您遵循Apple针对笔尖对象内存管理的指导原则。 http://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/MemoryMgmt/Articles/mmNibObjects.html#//apple_ref/doc/uid/TP40004998-SW2 – 2010-10-08 04:23:06