开发者

Which method is accessible when moved to previous View

开发者 https://www.devze.com 2023-03-29 04:19 出处:网络
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

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

精彩评论

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