2011-10-01 5 views
0

우리는 한 번씩 다음과 같은 정보를 얻습니다. 이 오류는 다시 생성 할 수 없습니다.UITableView에서 _updateNumSections에 대해 SIGSEGV가 발생하는 이유는 무엇입니까?

누구나 구체적으로이 원인을 알고 있습니까? 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) 
+0

충돌하는보기에서 tableView 코드를 게시하십시오. – WrightsCS

+0

어느 것이 될지 확실하지 않습니다. 스택에서 볼 수있는 테이블보기조차도 알 수 없습니다. 뭘 잘못 생각 했니? 이것은 나를 미치게합니다. :) – tjg184

+0

또한, 이것은 지속적으로 충돌하지 않습니다. 나는 그것이 기억에 관해 불쾌한 약간의 의심 스럽지만 확실하지 않다. – tjg184

답변

3

콘솔 로그를보고 시작하십시오. 어느 클래스가 updateNumSections으로 전송되었는지를 나타내는 메시지가 표시됩니다.

백그라운드 스레드에서이 테이블 뷰를 호출하지 않도록하십시오. 그것은 이런 종류의 미친 충돌을 일으킬 수 있습니다.

테이블보기 전에 테이블보기 데이터 소스의 할당이 해제되어 있지 않은지 확인하십시오.

여기에있는 혐의는 (당신이 제안한 것처럼) 과도한 발표가 될 것이므로, 정적 분석을 실행하여 뼈가있는 물건을 찾으십시오. 또한 ivars를 직접 사용하는 것이 아니라 접근자를 사용하고 있는지 확인하십시오 (초과 출시의 # 1 원인).

+1

이러한 모든 훌륭한 제안에 감사드립니다. 내가 생각했던 문제는 "popViewControllerAnimated"를 viewDidDisappear에서 UITableView를 사용하여 뷰에 호출했다는 것입니다. 탭이나 다른 동작을 전환 할 때보기를 팝업하려고했습니다. 이 충돌을 초래 한보기 제어기의 두 개의 팝이 발생했습니다. viewToDisPear에서 popToViewController를 제거하고 탭 막대 컨트롤러의 실제 대리자에 넣습니다. 아직도 이슈를 재현 할 수 없다는 것이 여전히 의미가 없습니다. 어쨌든, 나는 이것이 여전히 펑키 한 행동을하게 될 것이라고 믿는다. – tjg184

0

나는 Rob Napier의 대답에 대한 의견에서 제안한 것과 같은 문제가 있었지만 viewDidDisappear 대신 tabBarController에서 구현해야합니다.

악기에서 좀비를 실행하면 updateNumSections에 대한 호출이 할당 해제 된 객체에 적용됨을 알 수 있습니다.

이 문제를보고있는 사용자는 더 이상 표시되지 않는 탭 내에서 호출되는 navigationViewController를 사용하여 tabViewController에서 사용해야하는 코드를 확인할 수 있습니다.

- (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController { 
    //Always go to the root controller when accessing a tab. 
    //If any navigation controller that must remember its last state, change this for viewController == or != 
    if ([viewController isKindOfClass:[UINavigationController class]]) { 
     [(UINavigationController*)viewController popToRootViewControllerAnimated:YES]; //Do not use code on disappear, instead popToRoot on tab selection 
    } 
} 
0

나는 백그라운드 스레드에서 테이블 뷰를 업데이트하지 않는다고 확신한다.

감사합니다. @ Pierre-Francoys, 나는 좀비 옵션을 추가하고 선택자 numberOfSectionsInTableView:이 할당 해제 된 개체로 전송되었음을 알려줍니다. 그래서 내 viewController에서 dataSource 및 tableView 대리인을 지 웁니다. 그리고 그것은 아주 잘 작동합니다.

- (void)dealloc { 
    _tableView.dataSource = nil; 
    _tableView.delegate = nil; 
} 
관련 문제