[英]Is there a delegate in the parent view controller that gets called after a modal view gets dismissed?
[英]View gets called on the wrong tab
我有主ViewController,其中有一個tabBar和一個navBar。
我的tabBar有2個按鈕,在第一個視圖中,我向其navBar添加了一個Add按鈕,該按鈕應調用另一個視圖。 除在另一個選項卡(而不是單擊按鈕的視圖)上調用此視圖之外,此方法工作正常。
這是我的代碼:
-(void)add:(id)sender
{
newItem *detailViewController = [[newItem alloc] initWithNibName:@"newItem" bundle:nil];
[navController pushViewController:detailViewController animated:YES];
[detailViewController release];
}
為什么不起作用?
抱歉,但是您怎么知道它被添加到錯誤的viewcontroller中? pushViewController應該只是將一個新的viewcontroller推入正在調用它的navigationController中。 您使用的是正確的navigationController嗎?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.