2012-03-07 4 views
0

NIB에서로드 한 View Controller에 문제가 있습니다. 이 NIB에는 두 가지 견해, 풍경 및 초상화가 있습니다. willAnimateForRotation 나는 내가 처음에tableView setEditing으로 인해 cellForRow가 조기에 호출되지 않습니다.

// willAnimateForRotation.. 
if (isLandscape) { 
    self.view = self.viewLandscape; 
} 
else { 
    self.view = self.portraitView; 
} 

을 설정 발생하면 I 편집 모드로 두 테이블을 설정

// viewDidLoad 
[self.tableViewPortrait setEditing:YES animated:NO]; 
[self.tableViewLandscape setEditing:YES animated:NO]; // * 

// *
나는 꽤이 줄 cellForRow의 원인이 있는지 확인 tableViewLandscape 호출 할 수입니다 이 시점에서, 내가 self.tableView = self.tableViewLandscape를 설정할 때 대신

2 번 방향 변경을 수행하면 tableView에 항목이 올바르게로드됩니다.

오리 엔테이션 변경에서 [self.tableView reloadData]를하고 싶지 않습니다. 중복 될 수 있습니다.

아무에게도이 문제를 해결할 수있는 좀 더 우아한 방법을 찾을 수 있습니까?

//willAnimateToRotation.. 
if (!self.tableViewLandscape.editing) 
{ 
    [self.tableViewLandscape setEditing:YES animated:NO]; 
} 

그에게 싼 해킹을하지만, 더 정확한 솔루션을 생각할 수 없다 :

답변

0

좋아, 최고의 I는 가지고 올 수 있습니다.

관련 문제