2013-06-28 47 views

回答

3

如果您將所描述的內容直接轉換爲代碼,則會如此。

NSUInteger index = [self.navigationController.viewControllers indexOfObject:self]; 
BOOL b = index != NSNotFound && index != 0; 

你寫,當你UINavigationController是不是在堆棧的頂部可能無法正常工作的代碼。

+0

感謝您指出我原來的代碼中的錯誤! –

1

[self.navigationController popToViewController:[self.navigationController.viewControllers objectAtIndex :([self.navigationController.viewControllers count] -2)] animated:YES];

相關問題