![](/img/trans.png)
[英]detailview screen can not open with pushViewController in a tableview
[英]Screen refresh in Tableview after call to DetailView Controoler
我要在加載表視圖后執行以下行以添加詳細信息:
if (!self.addView) {
self.addView = [[AddView alloc] initWithNibName:@"AddView" bundle:nil];
}
[self.navigationController pushViewController:self.addView animated:YES];
NSLog(@"I am done, now what");
然后出現一個文本框屏幕...輸入數據並保存到一個plist中...然后以編程方式返回,請執行以下行:
[self.navigationController popToRootViewControllerAnimated:NO];
我的問題是如何用新記錄刷新表視圖? 我知道它在viewWillAppear方法[self.tableview reloadData]中,但是我如何觸發viewWillAppear,因為返回后它並沒有加入該方法? 任何幫助,將不勝感激。 問候,
如果要在每次tableView即將出現時都運行reloadData,則可以在viewWillAppear中運行[self.tableview reloadData]。
您可能希望將[self.tableView reloadData]
放在viewWillAppear
方法中,而不是viewDidLoad
方法中。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.