我們使用導航控制器和視圖控制器向用戶顯示問題。一切工作正常,但我們做了一些用戶界面調整,所以我們可以將應用程序移植到iPad上,唯一的變化是使桌面視圖的框架動態變爲iphone或ipad。但是現在,當我們到達335中的187問題時,它不再推新問題......它推動了一個空白屏幕,並且從未調用推送的視圖控制器的「viewDidLoad」方法,因爲它已經是過去了187次。我們已經設置了斷點,以確保導航控制器和視圖控制器仍然分配在內存中,並且它們是。UINavigationController停止推送視圖
這裏是被稱爲每次新推視圖控制器的viewDidLoad中......
- (void)viewDidLoad {
_tableView = [[QuestionTableView alloc] initWithFrame:self.view.frame style:UITableViewStyleGrouped];
_tableView.center = CGPointMake(self.view.center.x, self.view.frame.size.height/2);
[_tableView setDataSource:self];
[_tableView setQuestionDelegate:self];
[_tableView setDelegate:self];
_tableView.scrollEnabled = YES;
[_tableView setBackgroundView:[[[UIView alloc] init] autorelease]];
_tableView.directionalLockEnabled = YES;
_tableView.delaysContentTouches = NO;
_tableView.backgroundColor = [UIColor clearColor];
_tableView.opaque = NO;
[self.view addSubview:_tableView];
}
我們通過推視圖控制器...
[questionsNavigationController pushViewController:viewController animated:YES];
在先進的感謝! :)
也只是想提一提,如果我們在模擬器中運行它沒有問題......如果我們在ipad或ipad2上運行它,我們有上面列出的問題 – kilabyte
您在導航堆棧上有187個視圖控制器?我會從那裏開始... –
沒有它的同一個控制器被推入不同的表數據。 – kilabyte