我们偶尔会收到以下内容。我们无法重新创建此错误。

有谁知道是什么原因造成的?似乎UITableView处于某种奇怪的状态。我已经运行仪器以查找过度释放的内存等,但是看不到太多。

Thread 0 Crashed:
    libobjc.A.dylib                     0x3068f06b _objc_terminate + 103
    libstdc++.6.dylib                   0x30502e3d __cxxabiv1::__terminate(void (*)()) + 53
    libstdc++.6.dylib                   0x30502e91 std::terminate() + 17
    libstdc++.6.dylib                   0x30502f61 __cxa_throw + 85
    libobjc.A.dylib                     0x3068dc8b objc_exception_throw + 71
    CoreFoundation                      0x335141bf -[NSObject(NSObject) doesNotRecognizeSelector:] + 103
    CoreFoundation                      0x33513649 ___forwarding___ + 509
    CoreFoundation                      0x3348a180 _CF_forwarding_prep_0 + 48
    UIKit                               0x31bb2ff3 -[UITableViewRowData(UITableViewRowDataPrivate) _updateNumSections] + 67
    UIKit                               0x31bb2f53 -[UITableViewRowData invalidateAllSections] + 51
    UIKit                               0x31bb2d09 -[UITableView(_UITableViewPrivate) _updateRowData] + 65
    UIKit                               0x31bafab7 -[UITableView _rectChangedWithNewSize:oldSize:] + 111
    UIKit                               0x31bae833 -[UITableView setFrame:] + 159
    UIKit                               0x31bb5e0f -[UIView(Geometry) resizeWithOldSuperviewSize:] + 275
    UIKit                               0x31b820bd -[UIView(Geometry) resizeSubviewsWithOldSize:] + 121
    UIKit                               0x31b674e9 -[UIView(Geometry) setFrame:] + 337
    UIKit                               0x31bb5e0f -[UIView(Geometry) resizeWithOldSuperviewSize:] + 275
    UIKit                               0x31b820bd -[UIView(Geometry) resizeSubviewsWithOldSize:] + 121
    UIKit                               0x31b674e9 -[UIView(Geometry) setFrame:] + 337
    UIKit                               0x31bae9fd -[UIScrollView setFrame:] + 421
    UIKit                               0x31bb5e0f -[UIView(Geometry) resizeWithOldSuperviewSize:] + 275
    UIKit                               0x31b820bd -[UIView(Geometry) resizeSubviewsWithOldSize:] + 121
    UIKit                               0x31b674e9 -[UIView(Geometry) setFrame:] + 337
    UIKit                               0x31bb5e0f -[UIView(Geometry) resizeWithOldSuperviewSize:] + 275
    UIKit                               0x31b820bd -[UIView(Geometry) resizeSubviewsWithOldSize:] + 121
    UIKit                               0x31b674e9 -[UIView(Geometry) setFrame:] + 337
    UIKit                               0x31bb9193 -[UIViewControllerWrapperView setFrame:] + 63
    UIKit                               0x31bb5e0f -[UIView(Geometry) resizeWithOldSuperviewSize:] + 275
    UIKit                               0x31b820bd -[UIView(Geometry) resizeSubviewsWithOldSize:] + 121
    UIKit                               0x31b674e9 -[UIView(Geometry) setFrame:] + 337
    UIKit                               0x31bb5e0f -[UIView(Geometry) resizeWithOldSuperviewSize:] + 275
    UIKit                               0x31b820bd -[UIView(Geometry) resizeSubviewsWithOldSize:] + 121
    UIKit                               0x31b674e9 -[UIView(Geometry) setFrame:] + 337
    UIKit                               0x31b9922f -[UILayoutContainerView setFrame:] + 55
    UIKit                               0x31bb90a9 +[UIViewControllerWrapperView wrapperViewForView:frame:] + 225
    UIKit                               0x31bd6201 -[UITabBarController transitionFromViewController:toViewController:transition:shouldSetSelected:] + 105
    UIKit                               0x31bd618d -[UITabBarController transitionFromViewController:toViewController:] + 33
    UIKit                               0x31bd5a33 -[UITabBarController _setSelectedViewController:] + 187
    UIKit                               0x31c5aceb -[UITabBarController setSelectedViewController:] + 15
    UIKit                               0x31c5abe7 -[UITabBarController _tabBarItemClicked:] + 227
    CoreFoundation                      0x33480571 -[NSObject(NSObject) performSelector:withObject:withObject:] + 25
    UIKit                               0x31b7eec9 -[UIApplication sendAction:to:from:forEvent:] + 85
    UIKit                               0x31b7ee69 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 33
    UIKit                               0x31c5aa8b -[UITabBar _sendAction:withEvent:] + 271
    CoreFoundation                      0x33480571 -[NSObject(NSObject) performSelector:withObject:withObject:] + 25
    UIKit                               0x31b7eec9 -[UIApplication sendAction:to:from:forEvent:] + 85
    UIKit                               0x31b7ee69 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 33
    UIKit                               0x31b7ee3b -[UIControl sendAction:to:forEvent:] + 39
    UIKit                               0x31b7eb8d -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 357
    UIKit                               0x31bb8bd9 -[UIControl sendActionsForControlEvents:] + 17
    UIKit                               0x31c5a815 -[UITabBar(Static) _buttonUp:] + 81
    CoreFoundation                      0x33480571 -[NSObject(NSObject) performSelector:withObject:withObject:] + 25
    UIKit                               0x31b7eec9 -[UIApplication sendAction:to:from:forEvent:] + 85
    UIKit                               0x31b7ee69 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 33
    UIKit                               0x31b7ee3b -[UIControl sendAction:to:forEvent:] + 39
    UIKit                               0x31b7eb8d -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 357
    UIKit                               0x31b7f423 -[UIControl touchesEnded:withEvent:] + 343
    UIKit                               0x31b7dbf5 -[UIWindow _sendTouchesForEvent:] + 369
    UIKit                               0x31b7d56f -[UIWindow sendEvent:] + 263
    UIKit                               0x31b66313 -[UIApplication sendEvent:] + 299
    UIKit                               0x31b65c53 _UIApplicationHandleEvent + 5091
    GraphicsServices                    0x311a5e77 PurpleEventCallback + 667
    CoreFoundation                      0x334e7a97 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 27
    CoreFoundation                      0x334e983f __CFRunLoopDoSource1 + 167
    CoreFoundation                      0x334ea60d __CFRunLoopRun + 521
    CoreFoundation                      0x3347aec3 CFRunLoopRunSpecific + 231
    CoreFoundation                      0x3347adcb CFRunLoopRunInMode + 59
    GraphicsServices                    0x311a541f GSEventRunModal + 115
    GraphicsServices                    0x311a54cb GSEventRun + 63
    UIKit                               0x31b90d69 -[UIApplication _run] + 405
    UIKit                               0x31b8e807 UIApplicationMain + 671
    MyApp                              0x0009a188 main (main.m:5)

最佳答案

首先查看控制台日志。将出现一条消息,指示已向哪个类发送了updateNumSections

确保您没有在后台线程上对此表 View 进行调用。这可能会导致此类疯狂的崩溃。

确保表 View 数据源没有在表 View 之前取消分配。

此处的怀疑可能是释放过度(如您所建议的),因此运行“静态分析”只是为了找到骨头的东西。另外,请确保您使用的是访问器,而不是直接使用ivars(导致过度释放的第一原因)。

关于iphone - 是什么导致UITableView的_updateNumSections上出现SIGSEGV?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/7618646/

10-13 03:42