سؤال

I have a 3 tab view controller. One of the tabs has a table view retrieved from a JSON request/response. When I initially go to this tab, the table loads fine from the viewDidLoad. But when I go to another tab and come back to the table view tab, it still has the old table values. i want to make another JSON request and display the response. How do I request another JSON request when the use comes back to this tab?

هل كانت مفيدة؟

المحلول

How Douglas said in the comment, add your reload-function in the viewWillAppear

-(void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    [self reloadMyData];
}
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top