开发者

Which method is accessible when moved to previous View

I have 2 views:

In the first view I have added another view:

[self.view addSubView:self.secondView];

In Second View when i Press Back then i have remove the second view for back to the first View

[self.view removeFromSuperView];

but in my first view there is the UITableView I have to use [UITableView reloadData]; method of UITableVi开发者_C百科ew but I don't know which method is called when secondView is removed.

My main objective is to call some method when I remove the second view and call any method which will reload the data.

Thanking in advance.


You can use viewDidAppear for your first view to call [UITableView reloadData];. It should be called each time that view appears.


You should use viewWillAppear as it will not refresh while the user is looking at it.

-(void)viewWillAppear{
   [super viewWillAppear];
   [self.tableView reloadData];
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜