0
我有viewcontroller與表視圖,當我點擊一個單元格我去導航到另一個視圖控制器與另一個tableview。uitableview的問題,當返回
我嘗試在第一個viewcontroller中使用viewDidAppear和viewWillAppear,當我從第二個viewcontroller回到這個viewcontroller時,我會輸入這個方法之一。
問題是當我返回到這個viewcontroller時他沒有進入這個方法。
這是我如何進入第二視圖控制器:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
ProfileViewController2 *tmp = [[ProfileViewController2 alloc]initWithType:indexPath.row string:[self.array2 objectAtIndex:indexPath.row]];
[[self navigationController] pushViewController:tmp animated:YES];
[tmp release];
[self.mytableview deselectRowAtIndexPath:indexPath animated:YES];
}
'viewWillAppear:'應該被調用。你想在'viewWillAppear:'中做什麼,以及你是如何返回到第一個視圖控制器的。 – 2011-06-15 00:59:06