Calling method in current view controller from App Delegate in iOS

To do the refresh of the view do not call viewWillAppear if the view is already displayed. What you want to do is the following:

When ConnectionDidFinishLoading method is triggered post a notification

[[NSNotificationCenter defaultCenter] postNotificationName:@"refreshView" object:nil];

In your viewController observe for this notification. You do it by adding this code to your init or viewDidLoad method

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(refreshView:) name:@"refreshView" object:nil];

Now implement -(void)refreshView:(NSNotification *) notification method in your viewController to manage your view to your liking.

Leave a Comment