【发布时间】:2014-07-03 08:16:34
【问题描述】:
发生了什么?
我在一个程序中遇到一个异常,在该程序中,一个函数将被调用 On a Button 点击 contentView 的 UItableViewCell 内的自定义视图
我尝试了什么?
1) 我尝试在Breakpoints Navigator 中添加一个全局异常点
2) 从Instruments
检查僵尸检测3) 应该调用的函数中的断点
我收到的崩溃日志?
-[UIImageView nextPage:]: unrecognized selector sent to instance 0xa7d5f20
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIImageView nextPage:]: unrecognized selector sent to instance 0xa7d5f20'
*** First throw call stack:
(
0 CoreFoundation 0x023e11e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x01fc98e5 objc_exception_throw + 44
2 CoreFoundation 0x0247e243 -[NSObject(NSObject) doesNotRecognizeSelector:] + 275
3 CoreFoundation 0x023d150b ___forwarding___ + 1019
4 CoreFoundation 0x023d10ee _CF_forwarding_prep_0 + 14
5 libobjc.A.dylib 0x01fdb880 -[NSObject performSelector:withObject:withObject:] + 77
6 UIKit 0x009463b9 -[UIApplication sendAction:to:from:forEvent:] + 108
7 UIKit 0x00946345 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 61
8 UIKit 0x00a47bd1 -[UIControl sendAction:to:forEvent:] + 66
9 UIKit 0x00a47fc6 -[UIControl _sendActionsForEvents:withEvent:] + 577
10 UIKit 0x00a47243 -[UIControl touchesEnded:withEvent:] + 641
11 UIKit 0x00cdc2e3 _UIGestureRecognizerUpdate + 7166
12 UIKit 0x00985a5a -[UIWindow _sendGesturesForEvent:] + 1291
13 UIKit 0x00986971 -[UIWindow sendEvent:] + 1021
14 UIKit 0x009585f2 -[UIApplication sendEvent:] + 242
15 UIKit 0x00942353 _UIApplicationHandleEventQueue + 11455
16 CoreFoundation 0x0236a77f __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
17 CoreFoundation 0x0236a10b __CFRunLoopDoSources0 + 235
18 CoreFoundation 0x023871ae __CFRunLoopRun + 910
19 CoreFoundation 0x023869d3 CFRunLoopRunSpecific + 467
20 CoreFoundation 0x023867eb CFRunLoopRunInMode + 123
21 GraphicsServices 0x0381a5ee GSEventRunModal + 192
22 GraphicsServices 0x0381a42b GSEventRun + 104
23 UIKit 0x00944f9b UIApplicationMain + 1225
24 IslamBox 0x000029bc main + 76
25 libdyld.dylib 0x034b3701 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
函数注册在 Nib 文件中,我还能做什么?
更新: 如日志所述 - [UIImageView nextpage] 无法识别,但下一页位于 ViewController 中。因为自定义视图是添加到单元格内容视图的 ViewController 的视图。
【问题讨论】:
-
检查你调用 nextPage: 的位置。如果你添加你的代码,它会更好地帮助你。
-
你能分享你的按钮选择器和cellForRowAtIndexPath的代码吗:
-
在 cellForRowAtIndexPath 中有一个视图控制器,其视图被添加该控制器包含其功能定义
-
其实在viewcontroller中注册了IBAction的View就是Button。但是日志说找不到 [UIImageView nextPage]。不应该是[viewcontroller nextPage]?
-
请使用您的自定义视图实现和按钮选择器编辑您的答案。这将有助于其他人回答您的问题。
标签: ios iphone objective-c uitableview ios7