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

  • SEARCH
  • Home
  • 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 6596841
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:07:45+00:00 2026-05-25T18:07:45+00:00

When my view controller is first presented, I want it to potentially update a

  • 0

When my view controller is first presented, I want it to potentially update a cache that provides the data for that view. However, when the user taps the back button from a deeper view controller to return to this view controller, I don’t want to update the cache again.

Which event should I be using?

  • in init, I don’t have all the parameters I need yet.
  • viewWillAppear will be fired every time the view will appear.
  • viewDidLoad will be fired every time the view has been loaded from the nib, which I believe could happen a second time if there’s a memory warning. (Or is this wrong?) Since this is not a memory resident cache, it seems the wrong place to handle this.
  • having the caller call something extra is inelegant, if there’s a built-in way to handle this.

To clarify, this is not a memory resident cache. This is parsing an XML file to binary. The binary is loaded and unloaded in viewDidLoad and viewDidUnload. This is a prerequisite for that step, making sure the binary is up-to-date prior to it being loaded.

  • 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-05-25T18:07:46+00:00Added an answer on May 25, 2026 at 6:07 pm

    Using init may work, but I would recommend a simple subclass of UINavigationController. Create a new method called setRootTableViewController:(UITableViewController *)controller, or something like it. In the method implementation call this:

    [controller.tableView reloadData];
    [self pushViewController:controller animated:NO];
    

    reloadData will call all of your delegate and data source methods, and use them to update the table. If you want a special method call on your table view controller instead, you could change the method declaration to setRootTableViewController:(CustomTableViewController *)controller (or whatever your custom table controller is called), and replace the reloadData line with one that calls that method.

    Then, in your app delegate, instead of creating a UINavigationController and adding your custom view controller, create one of these, and call this method to add the first view.

    However, if you are using a nib to set the rootViewController, you can just override initWithRootViewController:(UIViewController *)controller, as I imagine that is what the nib will call to set the first view in the stack:

    - (id)initWithRootViewController:(UIViewController *)rootViewController {
      if ((self = [super init])) {
        [(CustomController *)rootViewController doSomethingSpecial];
        [self pushViewController:rootViewController];
      }
    }
    

    Hope this helps!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Table View Controller with cells. I want to update the text
How can I achieve this? Basically I have first a view controller that lists
Short: how does modelbinding pass objects from view to controller? Long: First, based on
I have two view controllers that allow changes to the Address Book. The first
I realise that the view/controller stuff will be different between Mac and IPhone apps
In the root table view controller I add a subview that holds an image:
I'm showing UINavigationController modally. For the root view controller, I don't want to show
I have a Navigation Controller that is presented modally with 4 views in the
First, in my root view controllers viewDidLoad, I initialize an NSDictionary with arrays of
In my view controller's -viewDidLoad method, I call [myTextField becomeFirstResponder]; This works like a

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.