使用 UIAlertView 时出现奇怪的 SIGABRT(无法识别的选择器发送到实例)

发布于 2024-09-19 18:25:19 字数 11549 浏览 3 评论 0原文

在过去的半个小时里,我一直在研究这个问题,所以我想我应该向 Stack Overflow 上的朋友们请教一些智慧。

我有一个标签栏应用程序,其中包含根视图控制器,并将视图传递给其他 xib。我创建了一个自定义 XIB,并将其视图控制器类 (MoreViewController) 添加为 Interface Builder 中的外部对象。当我链接方法时,使用 UIButton 调用该方法时出现 SIGABRT 错误:

Method

- (IBAction)showAbout {
    alert = [[[UIAlertView alloc] initWithTitle:@"About" message:@"yadda yadda yadda some message" delegate:self cancelButtonTitle:@"Dismiss" otherButtonTitles:nil] autorelease];
    [alert show];
}

Stack

2010-09-17 18:01:40.714 <appname>[7963:207] -[__NSCFType showAbout]: unrecognized selector sent to instance 0x5f6ef10
2010-09-17 18:01:40.716 <appname>[7963:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFType showAbout]: unrecognized selector sent to instance 0x5f6ef10'
*** Call stack at first throw:
(
    0   CoreFoundation                      0x0247eb99 __exceptionPreprocess + 185
    1   libobjc.A.dylib                     0x025ce40e objc_exception_throw + 47
    2   CoreFoundation                      0x024806ab -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
    3   CoreFoundation                      0x023f02b6 ___forwarding___ + 966
    4   CoreFoundation                      0x023efe72 _CF_forwarding_prep_0 + 50
    5   UIKit                               0x002b07f8 -[UIApplication sendAction:to:from:forEvent:] + 119
    6   UIKit                               0x0033bde0 -[UIControl sendAction:to:forEvent:] + 67
    7   UIKit                               0x0033e262 -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 527
    8   UIKit                               0x0033ce0f -[UIControl touchesEnded:withEvent:] + 458
    9   UIKit                               0x002d43d0 -[UIWindow _sendTouchesForEvent:] + 567
    10  UIKit                               0x002b5cb4 -[UIApplication sendEvent:] + 447
    11  UIKit                               0x002ba9bf _UIApplicationHandleEvent + 7672
    12  GraphicsServices                    0x02d5e822 PurpleEventCallback + 1550
    13  CoreFoundation                      0x0245fff4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
    14  CoreFoundation                      0x023c0807 __CFRunLoopDoSource1 + 215
    15  CoreFoundation                      0x023bda93 __CFRunLoopRun + 979
    16  CoreFoundation                      0x023bd350 CFRunLoopRunSpecific + 208
    17  CoreFoundation                      0x023bd271 CFRunLoopRunInMode + 97
    18  GraphicsServices                    0x02d5d00c GSEventRunModal + 217
    19  GraphicsServices                    0x02d5d0d1 GSEventRun + 115
    20  UIKit                               0x002beaf2 UIApplicationMain + 1160
    21  <appname>                           0x00001b30 main + 102
    22  <appname>                           0x00001ac1 start + 53
)
terminate called after throwing an instance of 'NSException'
Program received signal:  “SIGABRT”.
[Switching to process 7963]
(gdb)

Can有人对此有所了解吗?

提前致谢!


编辑 好吧,我已经启用了 NSZombie 并且...我收到了一个不太神秘的错误!呜呼!

2010-09-17 18:48:56.576 <appname>[8088:207] *** -[MoreViewController performSelector:withObject:withObject:]: message sent to deallocated instance 0x5fa98e0

编辑2使用Instruments的僵尸模式,我成功地发现了内存地址的内容,如下所示:

#   Category    Event Type  RefCt   Timestamp   Address Size    Responsible Library Responsible Caller
0   MoreViewController  Malloc  1   2968170752  0x5fa5ee0   144 UIKit   -[UIClassSwapper initWithCoder:]
1   MoreViewController  Retain  2   2968226816  0x5fa5ee0   0   UIKit   -[UIRuntimeConnection initWithCoder:]
2   MoreViewController  Retain  3   2968229888  0x5fa5ee0   0   Foundation  -[NSKeyedUnarchiver _replaceObject:withObject:]
3   MoreViewController  Release 2   2968232704  0x5fa5ee0   0   UIKit   -[UIRuntimeConnection initWithCoder:]
4   MoreViewController  Retain  3   2968236800  0x5fa5ee0   0   UIKit   -[UIRuntimeConnection initWithCoder:]
5   MoreViewController  Autorelease     2968259840  0x5fa5ee0   0   UIKit   -[UIRuntimeConnection initWithCoder:]
6   MoreViewController  Retain  4   2968262912  0x5fa5ee0   0   UIKit   -[UIRuntimeConnection initWithCoder:]
7   MoreViewController  Retain  5   2968322816  0x5fa5ee0   0   UIKit   -[UIRuntimeConnection initWithCoder:]
8   MoreViewController  Autorelease     2968324864  0x5fa5ee0   0   UIKit   -[UIRuntimeConnection initWithCoder:]
9   MoreViewController  Retain  6   2968331776  0x5fa5ee0   0   UIKit   -[UIRuntimeConnection initWithCoder:]
10  MoreViewController  Retain  7   2986161920  0x5fa5ee0   0   UIKit   -[UIRuntimeConnection initWithCoder:]
11  MoreViewController  Autorelease     2986163712  0x5fa5ee0   0   UIKit   -[UIRuntimeConnection initWithCoder:]
12  MoreViewController  Retain  8   2986166784  0x5fa5ee0   0   UIKit   -[UIRuntimeConnection initWithCoder:]
13  MoreViewController  Retain  9   2986367744  0x5fa5ee0   0   UIKit   -[UIRuntimeConnection initWithCoder:]
14  MoreViewController  Autorelease     2986369792  0x5fa5ee0   0   UIKit   -[UIRuntimeConnection initWithCoder:]
15  MoreViewController  Retain  10  2986371840  0x5fa5ee0   0   UIKit   -[UIRuntimeConnection initWithCoder:]
16  MoreViewController  Release 9   2986498816  0x5fa5ee0   0   UIKit   -[UINib instantiateWithOwner:options:]
17  MoreViewController  Release 8   2986510848  0x5fa5ee0   0   UIKit   -[UINib instantiateWithOwner:options:]
18  MoreViewController  Release 7   2986524928  0x5fa5ee0   0   UIKit   -[UINib instantiateWithOwner:options:]
19  MoreViewController  Release 6   2986529792  0x5fa5ee0   0   UIKit   -[UINib instantiateWithOwner:options:]
20  MoreViewController  Retain  7   2986635008  0x5fa5ee0   0   Foundation  -[NSKeyedUnarchiver _decodeArrayOfObjectsForKey:]
21  MoreViewController  Retain  8   2986648832  0x5fa5ee0   0   Foundation  -[NSKeyedUnarchiver _decodeArrayOfObjectsForKey:]
22  MoreViewController  Release 7   2986650880  0x5fa5ee0   0   Foundation  -[NSKeyedUnarchiver _decodeArrayOfObjectsForKey:]
23  MoreViewController  Retain  8   2986679040  0x5fa5ee0   0   Foundation  -[NSArray(NSArray) initWithCoder:]
24  MoreViewController  Release 7   2986705920  0x5fa5ee0   0   UIKit   -[UINib instantiateWithOwner:options:]
25  MoreViewController  Retain  8   2986823936  0x5fa5ee0   0   Foundation  -[NSKeyedUnarchiver _decodeArrayOfObjectsForKey:]
26  MoreViewController  Retain  9   2986860800  0x5fa5ee0   0   Foundation  -[NSKeyedUnarchiver _decodeArrayOfObjectsForKey:]
27  MoreViewController  Release 8   2986900736  0x5fa5ee0   0   Foundation  -[NSKeyedUnarchiver _decodeArrayOfObjectsForKey:]
28  MoreViewController  Retain  9   2986923776  0x5fa5ee0   0   Foundation  -[NSArray(NSArray) initWithCoder:]
29  MoreViewController  Release 8   2986969856  0x5fa5ee0   0   UIKit   -[UINib instantiateWithOwner:options:]
30  MoreViewController  Retain  9   2987261952  0x5fa5ee0   0   UIKit   -[UINib instantiateWithOwner:options:]
31  MoreViewController  Release 8   2987425792  0x5fa5ee0   0   Foundation  -[NSKeyedUnarchiver dealloc]
32  MoreViewController  Release 7   2987520000  0x5fa5ee0   0   Foundation  -[NSKeyedUnarchiver dealloc]
33  MoreViewController  Release 6   2987686656  0x5fa5ee0   0   Foundation  -[NSKeyedUnarchiver dealloc]
34  MoreViewController  Release 5   2987698944  0x5fa5ee0   0   Foundation  -[NSKeyedUnarchiver dealloc]
35  MoreViewController  Release 4   2987756032  0x5fa5ee0   0   UIKit   -[UIRuntimeConnection dealloc]
36  MoreViewController  Release 3   2987793920  0x5fa5ee0   0   UIKit   -[UIRuntimeConnection dealloc]
37  MoreViewController  Release 2   2987811840  0x5fa5ee0   0   UIKit   -[UIRuntimeConnection dealloc]
38  MoreViewController  Release 1   2987849984  0x5fa5ee0   0   UIKit   -[UIRuntimeConnection dealloc]
39  MoreViewController  Release 0   2994390016  0x5fa5ee0   0   Foundation  -[NSAutoreleasePool release]
40  MoreViewController  Zombie  -1  6312182784  0x5fa5ee0   0   UIKit   -[UIApplication sendAction:to:from:forEvent:]

我确实注意到之前调用了-[NSAutoreleasePool release] -[UIApplication sendAction:to:from:forEvent:]...这可能是我的问题吗?我该如何解决这个问题?

再次感谢您的回复,每个人都有帮助。


编辑4

来自info malloc命令的输出

2010-09-17 19:41:57.305 <appname>[8440:207] *** -[MoreViewController performSelector:withObject:withObject:]: message sent to deallocated instance 0x63ae170
[Switching to process 8440]
(gdb) info malloc 0x63ae170
Alloc: Block address: 0x063ae170 length: 132
Stack - pthread: 0xa0541500 number of frames: 49
    0: 0x947170c3 in malloc_zone_calloc
    1: 0x9471701a in calloc
    2: 0x25cdb5b in _internal_class_createInstanceFromZone
    3: 0x25d07a6 in class_createInstance
    4: 0x23a3108 in +[NSObject(NSObject) allocWithZone:]
    5: 0x23a2f0a in +[NSObject(NSObject) alloc]
    6: 0x4a6039 in -[UIClassSwapper initWithCoder:]
    7: 0x1669c in _decodeObjectBinary
    8: 0x15809 in _decodeObject
    9: 0x4a5d77 in -[UIRuntimeConnection initWithCoder:]
   10: 0x4a62e5 in -[UIRuntimeEventConnection initWithCoder:]
   11: 0x1669c in _decodeObjectBinary
   12: 0x1746d in -[NSKeyedUnarchiver _decodeArrayOfObjectsForKey:]
   13: 0x17a9c in -[NSArray(NSArray) initWithCoder:]
   14: 0x1669c in _decodeObjectBinary
   15: 0x15809 in _decodeObject
   16: 0x4a5034 in -[UINib instantiateWithOwner:options:]
   17: 0x4a6eb5 in -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:]
   18: 0x35c95f in -[UIViewController _loadViewFromNibNamed:bundle:]
   19: 0x35a675 in -[UIViewController loadView]
   20: 0x35a54f in -[UIViewController view]
   21: 0x36c73e in -[UITabBarController transitionFromViewController:toViewController:transition:shouldSetSelected:]
   22: 0x36b2b2 in -[UITabBarController transitionFromViewController:toViewController:]
   23: 0x36d08c in -[UITabBarController _setSelectedViewController:]
   24: 0x36cefb in -[UITabBarController _tabBarItemClicked:]
   25: 0x2b07f8 in -[UIApplication sendAction:to:from:forEvent:]
   26: 0x4ad2d0 in -[UITabBar _sendAction:withEvent:]
   27: 0x2b07f8 in -[UIApplication sendAction:to:from:forEvent:]
   28: 0x33bde0 in -[UIControl sendAction:to:forEvent:]
   29: 0x33e262 in -[UIControl(Internal) _sendActionsForEvents:withEvent:]
   30: 0x33bd97 in -[UIControl sendActionsForControlEvents:]
   31: 0x2b07f8 in -[UIApplication sendAction:to:from:forEvent:]
   32: 0x33bde0 in -[UIControl sendAction:to:forEvent:]
   33: 0x33e262 in -[UIControl(Internal) _sendActionsForEvents:withEvent:]
   34: 0x33ce0f in -[UIControl touchesEnded:withEvent:]
   35: 0x2d43d0 in -[UIWindow _sendTouchesForEvent:]
   36: 0x2b5cb4 in -[UIApplication sendEvent:]
   37: 0x2ba9bf in _UIApplicationHandleEvent
   38: 0x2d5e822 in PurpleEventCallback
   39: 0x245fff4 in __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__
   40: 0x23c0807 in __CFRunLoopDoSource1
   41: 0x23bda93 in __CFRunLoopRun
   42: 0x23bd350 in CFRunLoopRunSpecific
   43: 0x23bd271 in CFRunLoopRunInMode
   44: 0x2d5d00c in GSEventRunModal
   45: 0x2d5d0d1 in GSEventRun
   46: 0x2beaf2 in UIApplicationMain
   47: 0x1a78 in main at /Users/Sean/Desktop/<appname>/main.m:13
   48: 0x1a09 in start

编辑5

我还没有弄清楚这一点......可以有人帮忙吗?

I've been bashing my head in with this one for the past half hour, so I thought I'd ask my friends from Stack Overflow for some wisdom.

I've got a tab bar application with a view controller at the root, and passing off the views to other xibs. I created a custom XIB and added its view controller class (MoreViewController) as an External Object in Interface Builder. When I link my methods, I get a SIGABRT error when calling the method with a UIButton:

Method

- (IBAction)showAbout {
    alert = [[[UIAlertView alloc] initWithTitle:@"About" message:@"yadda yadda yadda some message" delegate:self cancelButtonTitle:@"Dismiss" otherButtonTitles:nil] autorelease];
    [alert show];
}

Stack

2010-09-17 18:01:40.714 <appname>[7963:207] -[__NSCFType showAbout]: unrecognized selector sent to instance 0x5f6ef10
2010-09-17 18:01:40.716 <appname>[7963:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFType showAbout]: unrecognized selector sent to instance 0x5f6ef10'
*** Call stack at first throw:
(
    0   CoreFoundation                      0x0247eb99 __exceptionPreprocess + 185
    1   libobjc.A.dylib                     0x025ce40e objc_exception_throw + 47
    2   CoreFoundation                      0x024806ab -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
    3   CoreFoundation                      0x023f02b6 ___forwarding___ + 966
    4   CoreFoundation                      0x023efe72 _CF_forwarding_prep_0 + 50
    5   UIKit                               0x002b07f8 -[UIApplication sendAction:to:from:forEvent:] + 119
    6   UIKit                               0x0033bde0 -[UIControl sendAction:to:forEvent:] + 67
    7   UIKit                               0x0033e262 -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 527
    8   UIKit                               0x0033ce0f -[UIControl touchesEnded:withEvent:] + 458
    9   UIKit                               0x002d43d0 -[UIWindow _sendTouchesForEvent:] + 567
    10  UIKit                               0x002b5cb4 -[UIApplication sendEvent:] + 447
    11  UIKit                               0x002ba9bf _UIApplicationHandleEvent + 7672
    12  GraphicsServices                    0x02d5e822 PurpleEventCallback + 1550
    13  CoreFoundation                      0x0245fff4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
    14  CoreFoundation                      0x023c0807 __CFRunLoopDoSource1 + 215
    15  CoreFoundation                      0x023bda93 __CFRunLoopRun + 979
    16  CoreFoundation                      0x023bd350 CFRunLoopRunSpecific + 208
    17  CoreFoundation                      0x023bd271 CFRunLoopRunInMode + 97
    18  GraphicsServices                    0x02d5d00c GSEventRunModal + 217
    19  GraphicsServices                    0x02d5d0d1 GSEventRun + 115
    20  UIKit                               0x002beaf2 UIApplicationMain + 1160
    21  <appname>                           0x00001b30 main + 102
    22  <appname>                           0x00001ac1 start + 53
)
terminate called after throwing an instance of 'NSException'
Program received signal:  “SIGABRT”.
[Switching to process 7963]
(gdb)

Can someone shed some light on this?

Thanks in advance!


EDIT
Ok, I've enabled NSZombie and... I get a less cryptic error! Woohoo!

2010-09-17 18:48:56.576 <appname>[8088:207] *** -[MoreViewController performSelector:withObject:withObject:]: message sent to deallocated instance 0x5fa98e0

EDIT 2 With Instruments' Zombie Mode, I've managed to uncover the contents of the memory address, listed below:

#   Category    Event Type  RefCt   Timestamp   Address Size    Responsible Library Responsible Caller
0   MoreViewController  Malloc  1   2968170752  0x5fa5ee0   144 UIKit   -[UIClassSwapper initWithCoder:]
1   MoreViewController  Retain  2   2968226816  0x5fa5ee0   0   UIKit   -[UIRuntimeConnection initWithCoder:]
2   MoreViewController  Retain  3   2968229888  0x5fa5ee0   0   Foundation  -[NSKeyedUnarchiver _replaceObject:withObject:]
3   MoreViewController  Release 2   2968232704  0x5fa5ee0   0   UIKit   -[UIRuntimeConnection initWithCoder:]
4   MoreViewController  Retain  3   2968236800  0x5fa5ee0   0   UIKit   -[UIRuntimeConnection initWithCoder:]
5   MoreViewController  Autorelease     2968259840  0x5fa5ee0   0   UIKit   -[UIRuntimeConnection initWithCoder:]
6   MoreViewController  Retain  4   2968262912  0x5fa5ee0   0   UIKit   -[UIRuntimeConnection initWithCoder:]
7   MoreViewController  Retain  5   2968322816  0x5fa5ee0   0   UIKit   -[UIRuntimeConnection initWithCoder:]
8   MoreViewController  Autorelease     2968324864  0x5fa5ee0   0   UIKit   -[UIRuntimeConnection initWithCoder:]
9   MoreViewController  Retain  6   2968331776  0x5fa5ee0   0   UIKit   -[UIRuntimeConnection initWithCoder:]
10  MoreViewController  Retain  7   2986161920  0x5fa5ee0   0   UIKit   -[UIRuntimeConnection initWithCoder:]
11  MoreViewController  Autorelease     2986163712  0x5fa5ee0   0   UIKit   -[UIRuntimeConnection initWithCoder:]
12  MoreViewController  Retain  8   2986166784  0x5fa5ee0   0   UIKit   -[UIRuntimeConnection initWithCoder:]
13  MoreViewController  Retain  9   2986367744  0x5fa5ee0   0   UIKit   -[UIRuntimeConnection initWithCoder:]
14  MoreViewController  Autorelease     2986369792  0x5fa5ee0   0   UIKit   -[UIRuntimeConnection initWithCoder:]
15  MoreViewController  Retain  10  2986371840  0x5fa5ee0   0   UIKit   -[UIRuntimeConnection initWithCoder:]
16  MoreViewController  Release 9   2986498816  0x5fa5ee0   0   UIKit   -[UINib instantiateWithOwner:options:]
17  MoreViewController  Release 8   2986510848  0x5fa5ee0   0   UIKit   -[UINib instantiateWithOwner:options:]
18  MoreViewController  Release 7   2986524928  0x5fa5ee0   0   UIKit   -[UINib instantiateWithOwner:options:]
19  MoreViewController  Release 6   2986529792  0x5fa5ee0   0   UIKit   -[UINib instantiateWithOwner:options:]
20  MoreViewController  Retain  7   2986635008  0x5fa5ee0   0   Foundation  -[NSKeyedUnarchiver _decodeArrayOfObjectsForKey:]
21  MoreViewController  Retain  8   2986648832  0x5fa5ee0   0   Foundation  -[NSKeyedUnarchiver _decodeArrayOfObjectsForKey:]
22  MoreViewController  Release 7   2986650880  0x5fa5ee0   0   Foundation  -[NSKeyedUnarchiver _decodeArrayOfObjectsForKey:]
23  MoreViewController  Retain  8   2986679040  0x5fa5ee0   0   Foundation  -[NSArray(NSArray) initWithCoder:]
24  MoreViewController  Release 7   2986705920  0x5fa5ee0   0   UIKit   -[UINib instantiateWithOwner:options:]
25  MoreViewController  Retain  8   2986823936  0x5fa5ee0   0   Foundation  -[NSKeyedUnarchiver _decodeArrayOfObjectsForKey:]
26  MoreViewController  Retain  9   2986860800  0x5fa5ee0   0   Foundation  -[NSKeyedUnarchiver _decodeArrayOfObjectsForKey:]
27  MoreViewController  Release 8   2986900736  0x5fa5ee0   0   Foundation  -[NSKeyedUnarchiver _decodeArrayOfObjectsForKey:]
28  MoreViewController  Retain  9   2986923776  0x5fa5ee0   0   Foundation  -[NSArray(NSArray) initWithCoder:]
29  MoreViewController  Release 8   2986969856  0x5fa5ee0   0   UIKit   -[UINib instantiateWithOwner:options:]
30  MoreViewController  Retain  9   2987261952  0x5fa5ee0   0   UIKit   -[UINib instantiateWithOwner:options:]
31  MoreViewController  Release 8   2987425792  0x5fa5ee0   0   Foundation  -[NSKeyedUnarchiver dealloc]
32  MoreViewController  Release 7   2987520000  0x5fa5ee0   0   Foundation  -[NSKeyedUnarchiver dealloc]
33  MoreViewController  Release 6   2987686656  0x5fa5ee0   0   Foundation  -[NSKeyedUnarchiver dealloc]
34  MoreViewController  Release 5   2987698944  0x5fa5ee0   0   Foundation  -[NSKeyedUnarchiver dealloc]
35  MoreViewController  Release 4   2987756032  0x5fa5ee0   0   UIKit   -[UIRuntimeConnection dealloc]
36  MoreViewController  Release 3   2987793920  0x5fa5ee0   0   UIKit   -[UIRuntimeConnection dealloc]
37  MoreViewController  Release 2   2987811840  0x5fa5ee0   0   UIKit   -[UIRuntimeConnection dealloc]
38  MoreViewController  Release 1   2987849984  0x5fa5ee0   0   UIKit   -[UIRuntimeConnection dealloc]
39  MoreViewController  Release 0   2994390016  0x5fa5ee0   0   Foundation  -[NSAutoreleasePool release]
40  MoreViewController  Zombie  -1  6312182784  0x5fa5ee0   0   UIKit   -[UIApplication sendAction:to:from:forEvent:]

I did notice that -[NSAutoreleasePool release] is called before -[UIApplication sendAction:to:from:forEvent:]... could that be my problem? How would I resolve that?

Thanks again for your responses, every one helps.


EDIT 4

Output from info malloc command:

2010-09-17 19:41:57.305 <appname>[8440:207] *** -[MoreViewController performSelector:withObject:withObject:]: message sent to deallocated instance 0x63ae170
[Switching to process 8440]
(gdb) info malloc 0x63ae170
Alloc: Block address: 0x063ae170 length: 132
Stack - pthread: 0xa0541500 number of frames: 49
    0: 0x947170c3 in malloc_zone_calloc
    1: 0x9471701a in calloc
    2: 0x25cdb5b in _internal_class_createInstanceFromZone
    3: 0x25d07a6 in class_createInstance
    4: 0x23a3108 in +[NSObject(NSObject) allocWithZone:]
    5: 0x23a2f0a in +[NSObject(NSObject) alloc]
    6: 0x4a6039 in -[UIClassSwapper initWithCoder:]
    7: 0x1669c in _decodeObjectBinary
    8: 0x15809 in _decodeObject
    9: 0x4a5d77 in -[UIRuntimeConnection initWithCoder:]
   10: 0x4a62e5 in -[UIRuntimeEventConnection initWithCoder:]
   11: 0x1669c in _decodeObjectBinary
   12: 0x1746d in -[NSKeyedUnarchiver _decodeArrayOfObjectsForKey:]
   13: 0x17a9c in -[NSArray(NSArray) initWithCoder:]
   14: 0x1669c in _decodeObjectBinary
   15: 0x15809 in _decodeObject
   16: 0x4a5034 in -[UINib instantiateWithOwner:options:]
   17: 0x4a6eb5 in -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:]
   18: 0x35c95f in -[UIViewController _loadViewFromNibNamed:bundle:]
   19: 0x35a675 in -[UIViewController loadView]
   20: 0x35a54f in -[UIViewController view]
   21: 0x36c73e in -[UITabBarController transitionFromViewController:toViewController:transition:shouldSetSelected:]
   22: 0x36b2b2 in -[UITabBarController transitionFromViewController:toViewController:]
   23: 0x36d08c in -[UITabBarController _setSelectedViewController:]
   24: 0x36cefb in -[UITabBarController _tabBarItemClicked:]
   25: 0x2b07f8 in -[UIApplication sendAction:to:from:forEvent:]
   26: 0x4ad2d0 in -[UITabBar _sendAction:withEvent:]
   27: 0x2b07f8 in -[UIApplication sendAction:to:from:forEvent:]
   28: 0x33bde0 in -[UIControl sendAction:to:forEvent:]
   29: 0x33e262 in -[UIControl(Internal) _sendActionsForEvents:withEvent:]
   30: 0x33bd97 in -[UIControl sendActionsForControlEvents:]
   31: 0x2b07f8 in -[UIApplication sendAction:to:from:forEvent:]
   32: 0x33bde0 in -[UIControl sendAction:to:forEvent:]
   33: 0x33e262 in -[UIControl(Internal) _sendActionsForEvents:withEvent:]
   34: 0x33ce0f in -[UIControl touchesEnded:withEvent:]
   35: 0x2d43d0 in -[UIWindow _sendTouchesForEvent:]
   36: 0x2b5cb4 in -[UIApplication sendEvent:]
   37: 0x2ba9bf in _UIApplicationHandleEvent
   38: 0x2d5e822 in PurpleEventCallback
   39: 0x245fff4 in __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__
   40: 0x23c0807 in __CFRunLoopDoSource1
   41: 0x23bda93 in __CFRunLoopRun
   42: 0x23bd350 in CFRunLoopRunSpecific
   43: 0x23bd271 in CFRunLoopRunInMode
   44: 0x2d5d00c in GSEventRunModal
   45: 0x2d5d0d1 in GSEventRun
   46: 0x2beaf2 in UIApplicationMain
   47: 0x1a78 in main at /Users/Sean/Desktop/<appname>/main.m:13
   48: 0x1a09 in start

EDIT 5

I still haven't figured this out... can ANYONE help?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

刘备忘录 2024-09-26 18:25:19

您收到此消息是因为您发送 showAbout: 的对象不响应该选择器。要么您指向了错误的目标,要么您的目标指针已被更改。

在没有看到更多代码的情况下很难说。如果您在 IB 中创建按钮,则可能没有正确连接插座。

编辑:根据您的新代码,您的 MoveViewController 对象似乎没有正确保留。要获取有关指定实例的信息,您可以像打开 NSZombieEnabled 一样打开 MallocStackLoggingNoCompact。当您收到错误时,您可以使用

malloc_history INSTANCE_ADDRESS

信息 malloc INSTANCE_ADDRESS

这是一篇关于此类调试的好文章

http://www.friday.com/bbum/2010/01/10/using-malloc-to-debug-memory-misuse-in-cocoa/

You are getting this because the object you are sending showAbout: to doesn't respond to that selector. Either you are pointing the the wrong target, or your target's pointer is being changed.

It's tough to say without seeing a little more code. If you are creating the button in IB, you probably don't have your outlets hooked up properly.

Edit: Based on your new code, it looks like your MoveViewController object isn't being retained properly. To get info about the instance you specificed, you can turn on MallocStackLoggingNoCompact the same way you turned on NSZombieEnabled. When you get your error, you can use either

malloc_history INSTANCE_ADDRESS

or

info malloc INSTANCE_ADDRESS

This is a great article for this kind of debugging

http://www.friday.com/bbum/2010/01/10/using-malloc-to-debug-memory-misuse-in-cocoa/

那伤。 2024-09-26 18:25:19

我没有找出原因,但通过将视图移动到一个 XIB 中解决了错误。

不管怎样,谢谢。

I didn't figure out the cause, but the errors were resolved by moving the views into one XIB.

Thanks anyway.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文