• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

ios - 向左滑动时,iOS 7 上的表格 View 崩溃

[复制链接]
菜鸟教程小白 发表于 2022-12-12 09:36:00 | 显示全部楼层 |阅读模式 打印 上一主题 下一主题

每当我在单元格上向左滑动时,我的应用程序就会崩溃,这就是我得到的结果

-[UITableViewCellScrollView _tableView]: unrecognized selector sent to instance 0x166a1960
-[UITableViewCellScrollView _tableView]: unrecognized selector sent to instance 0x166a1960
Stack Trace: (
    0   CoreFoundation                      0x2fc08f23 <redacted> + 154
    1   libobjc.A.dylib                     0x3a39fce7 objc_exception_throw + 38
    2   CoreFoundation                      0x2fc0c837 <redacted> + 202
    3   CoreFoundation                      0x2fc0b137 <redacted> + 706
    4   CoreFoundation                      0x2fb5a098 _CF_forwarding_prep_0 + 24
    5   UIKit                               0x3262ef91 <redacted> + 184
    6   UIKit                               0x325be3f5 <redacted> + 816
    7   UIKit                               0x32468a21 <redacted> + 148
    8   UIKit                               0x325ce0cf <redacted> + 78
    9   UIKit                               0x324681eb <redacted> + 458
    10  UIKit                               0x32467c4b <redacted> + 666
    11  UIKit                               0x3243ce75 <redacted> + 196
    12  UIKit                               0x3243b541 <redacted> + 7120
    13  CoreFoundation                      0x2fbd3fef <redacted> + 14
    14  CoreFoundation                      0x2fbd34b7 <redacted> + 206
    15  CoreFoundation                      0x2fbd1ca7 <redacted> + 630
    16  CoreFoundation                      0x2fb3c769 CFRunLoopRunSpecific + 524
    17  CoreFoundation                      0x2fb3c54b CFRunLoopRunInMode + 106
    18  GraphicsServices                    0x34aa96d3 GSEventRunModal + 138
    19  UIKit                               0x3249b891 UIApplicationMain + 1136
    20  Event Receiver                      0x000c3849 main + 116
    21  libdyld.dylib                       0x3a89dab7 <redacted> + 2
)

我尝试为 -[NSObject(NSObject) doesNotRecognizeSelector:] 添加符号断点,但没有显示哪段代码发送了该选择器

更新:这次我使用了模拟器,并试图让应用程序崩溃,我现在得到了这个:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UITableViewCellScrollView _tableView]: unrecognized selector sent to instance 0x8e46570'
*** First throw call stack:
(
    0   CoreFoundation                      0x01ad91e4 __exceptionPreprocess + 180
    1   libobjc.A.dylib                     0x018588e5 objc_exception_throw + 44
    2   CoreFoundation                      0x01b76243 -[NSObject(NSObject) doesNotRecognizeSelector:] + 275
    3   CoreFoundation                      0x01ac950b ___forwarding___ + 1019
    4   CoreFoundation                      0x01ac90ee _CF_forwarding_prep_0 + 14
    5   UIKit                               0x00785f7a -[UITableViewCellScrollView gestureRecognizerShouldBegin:] + 203
    6   UIKit                               0x008b5466 -[UIGestureRecognizer _shouldBegin] + 1309
    7   UIKit                               0x008b1d89 -[UIGestureRecognizer setState:] + 171
    8   UIKit                               0x008e39d7 -[UIPanGestureRecognizer touchesMoved:withEvent:] + 142
    9   UIKit                               0x0099792a -[UIScrollViewPanGestureRecognizer touchesMoved:withEvent:] + 89
    10  UIKit                               0x005597d8 -[UIWindow _sendGesturesForEvent:] + 649
    11  UIKit                               0x0055a971 -[UIWindow sendEvent:] + 1021
    12  UIKit                               0x0052c5f2 -[UIApplication sendEvent:] + 242
    13  UIKit                               0x00516353 _UIApplicationHandleEventQueue + 11455
    14  CoreFoundation                      0x01a6277f __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
    15  CoreFoundation                      0x01a6210b __CFRunLoopDoSources0 + 235
    16  CoreFoundation                      0x01a7f1ae __CFRunLoopRun + 910
    17  CoreFoundation                      0x01a7e9d3 CFRunLoopRunSpecific + 467
    18  CoreFoundation                      0x01a7e7eb CFRunLoopRunInMode + 123
    19  GraphicsServices                    0x03dba5ee GSEventRunModal + 192
    20  GraphicsServices                    0x03dba42b GSEventRun + 104
    21  UIKit                               0x00518f9b UIApplicationMain + 1225
    22  Event Receiver                      0x000056cd main + 141
    23  libdyld.dylib                       0x026a5701 start + 1
)



Best Answer-推荐答案


通过对单元格应用一些颜色,我看到当我从附件 View 中滑动单元格时,应用程序崩溃了

enter image description here


解决方法是在 tableView:cellForRowAtIndexPath: 中将附件类型设置为 UITableViewCellAccessoryNone:

cell.accessoryType = UITableViewCellAccessoryNone;


引用: -如何使用操作制作可滑动的表格 View 单元格 - ScrollView 不会发疯 here

-仔细查看表格 View 单元格here

关于ios - 向左滑动时,iOS 7 上的表格 View 崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23374829/

回复

使用道具 举报

懒得打字嘛,点击右侧快捷回复 【右侧内容,后台自定义】
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关注0

粉丝2

帖子830918

发布主题
阅读排行 更多
广告位

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap