Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8387037
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T18:06:26+00:00 2026-06-09T18:06:26+00:00

I want to reload data in UIViewController when application become active or become foreground.

  • 0

I want to reload data in UIViewController when application become active or become foreground.

I know applicationDidBecomeActive is called in AppDelegate class.
But I have to have a global variable for the UIViewController to reload its data in AppDelegate class like this code:

in AppDelegate.m

// global variable
UIViewController *viewController1;
UIViewController *viewController2;

-(void)applicationDidBecomeActive:(UIApplication *)application
{
    [viewController1 reloadData];
    [viewController2 reloadData];
}

But it is inconvenient especially when I have a lot of UIViewControllers.

Can I use applicationDidBecomeActive in UIViewController instead of in AppDelegate class?
Or are there better ways than having global variable for UIViewController?

I also need to use the following method from UIViewControllers:

-(void)applicationWillResignActive:(UIApplication *)application
-(void)applicationDidEnterBackground:(UIApplication *)application
-(void)applicationWillEnterForeground:(UIApplication *)application
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T18:06:28+00:00Added an answer on June 9, 2026 at 6:06 pm

    At the time of reactivation, if you want to carry a particular thing for a view controller, you should register a notification in its viewDidLoad method.

    UIApplicationDidBecomeActiveNotification will automatically notify your application and given controller, if they registered for it.

     [[NSNotificationCenter defaultCenter]addObserver:self
                                             selector:@selector(yourMethod)
                                                 name:UIApplicationDidBecomeActiveNotification
                                               object:nil];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to reload the data in the UIpicker view. actaully i have 2
I want to reload the data within a table view that is contained on
i want to reload ViewdidLoad in a method But now want to call again
$('#cart').load('shop.php/ #cart'); So i want to reload the cart section of my page but
I want to reload the table of data from server without refreshing it. How
I want my app to reload data when it will be reopened (from iOS
I want my app to reload data as soon as the app switches from
I have a c# winform application (2008) with datagridview bound to data from sqlserver.
I want to reload my page, or get the data from my popup result,
I have a problem to refresh or reload an application scoped managed bean. It

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.