2011-11-18 2 views
0

저는 앱을로드하고 방향을 변경하면 방향을 처리 할 수있는 앱을 만들고 있습니다. 그러나 나는 splitViewBased 앱 DetailViewController에서 테이블을 표시하고 SIGABRT와 함께 다음 내 응용 프로그램 충돌 방향을 변경 RootViewController의 모든 TableViewCell에 눌러 다음과 같은 메시지를 제공하는 경우 :iPad 오리엔테이션 변경은 SIGABRT 신호를 반환합니다.

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[_UITableViewReorderingSupport count]: unrecognized selector sent to instance 0x4e4eb30' 

방법 I가 쓰고 있어요 핸들 방향은

// Ensure that the view controller supports rotation and that the split view can therefore show in both portrait and landscape. 
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { 
    //hot fix sometimes in multilevel bar button is shown in landscape mode. 

    if (interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight) { 
     [[self navigationItem] setLeftBarButtonItem:nil]; 
    } 
    else { 
     [[self navigationItem] setLeftBarButtonItem:self.appDelegate.rootPopoverButtonItem]; 
    } 
    return YES; 
} 
+0

더 많은 코드를 포함해야합니다. 이와 같이 iOS 앱을 크래시하는 방법에는 여러 가지가 있습니다. 이 오류를 생성하는 뷰 중 하나에서'didRotateTo ... '또는'didRotateFrom ...'메소드에 코드가 거의 확실하게 있습니다. – MusiGenesis

+0

로테이션을 처리하기 위해 앱에있는 코드를 배치했습니다. – user1048396

+0

'_UIUITableViewReorderingSupport'에 'count'라는 메시지를 보냈습니다. 그게 뭐야? 뭘 계산하려고하는거야? –

답변

0

if 다음에 NSLog를 추가하고 다른 하나를 읽으면 충돌이 발생한 곳을 확인하십시오. didRotateTo 또는 didRotateFrom이있는 경우 NSLog를 추가하여 진행 상황을 확인하십시오.

예 : shouldAutorotate에서 if :/else를 돌려서 올바르게 회전하는지 확인하고 아무 것도 방해가되지 않도록하십시오.

마지막으로, 모든 방향 당신은 아마 테이블에 내용을로드 할 배열을 사용하는 것입니다

2

을 지원하고, 다시로드하거나 테이블을 채우는 시점에서 있는지 확인하기 위해 대상> 지원되는 장치의 방향을 확인 내용이있는 배열 수는 0이거나 배열 인스턴스가 범위를 잃어 버렸기 때문에 cellForRowAtIndexPath 대리자에서 직접 액세스하려고합니다. 그렇다면 배열을 유지하거나 할당하십시오.