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 6935137
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:03:45+00:00 2026-05-27T12:03:45+00:00

I have a navigation controller I created in a storyboard. The forward and back

  • 0

I have a navigation controller I created in a storyboard. The forward and back functions work fine…The part I am struggling with is how I can save state of the application when the back button is pressed. Is there a way I can have my current view controller be notified when the back button is pressed?

How can I use viewWillDisappear in this case:

    ReaderViewController *readerViewController = [[ReaderViewController alloc] initWithReaderDocument:document];
    readerViewController.title = model.title;
    readerViewController.delegate = self;
    [self.navigationController pushViewController:readerViewController animated:YES];
    [readerViewController release];

(I am using a pdf reader library)

  • 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-27T12:03:46+00:00Added an answer on May 27, 2026 at 12:03 pm

    Well, the view controller that is on the top of the stack (presently on screen) will get the viewWillDisappear: and viewDidDisappear: messages.

    viewWillDisappear: is a good place to save anything the user may have been editing or manipulating on that screen.

    Edit to address your followup:

    So when the user taps “back”, you’ll get these messages (I’m going to call the presenting view controller ‘rootViewController’)

    1. readerViewController will get viewWillDisappear:
    2. rootViewController will get viewWillAppear:
    3. readerViewController will get viewDidDisappear:
    4. rootViewController will get viewDidAppear:

    So if you have access to the ReaderViewController source, you can add/edit methods for those events. You can also set a delegate on the navigation controller, and that delegate will get navigationController:willShowViewController:animated: and navigationController:didShowViewController:animated: as the user comes back.

    But if you tell us more about this “ReaderViewController”, maybe it has delegate methods you can implement to save whatever state it manipulates. What “pdf reader library” is this? And what state exactly are you trying to save?

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

Sidebar

Related Questions

I have a navigation controller app. I created a RootViewController class with Xib file.
I have a navigation controller created programmatically to handle the switch between the views
I have a navigation controller which also has a table view. I want to
I have used navigation controller and 3 screens A,B,C. I have used navigation controller
In my IB I have a navigation controller which has in it a view
I have a tab-bar and navigation controller application (like Youtube app or Contacts app).
I have an iPhone app that is based on a navigation controller. I have
I have a screen with a webView in my navigation controller stack and when
i have just converted an app i was making from a navigation controller app
I have a core data application which uses a navigation controller to drill down

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.