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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T02:37:51+00:00 2026-05-22T02:37:51+00:00

This question has been asked before, but the answered ones I could find were

  • 0

This question has been asked before, but the answered ones I could find were from 2009 and don’t suit my problem. Let me reiterate the issue.

I have a UINavigationController that spawns and pushes lots of different UIViewControllers onto its stack. One of those deals with some Core Data operations that need to be saved when that one particular VC get’s popped off the stack. Don’t focus on the Core Data part, it’s about the popping.

How can I hook into the moment that the UIViewController is going to be popped off the stack?

  • I was hoping for a delegate method of some sort, but couldn’t find it. The UINavigationControllerDelegate protocol is very sparse.
  • I then started thinking of using viewWillDisappear, but that one is also called if another view is pushed onto the stack, so it doesn’t provide the right moment.
  • This answered question, from 2009, opts to look at the viewWillAppear of the view controller that we’re ‘popping to’, but since that call doesn’t have a reference to the VC that needs to do the checking, this is unsatisfactory and will introduce a level of dependency that is counter productive (the VC is used by several NCs).
  • Another answered question, also from 2009, opts to subclass UINavigationController and rewrite the popViewControllerAnimated: method. Or alternatively use the VC’s dealloc. My gut tells me that can’t be the way to go.
  • Finally there’s one last recent question from march 2011, but no one cared to answer it.

That leaves me in my current unsatisfied state of mind. Is there anyone out there with a better solution to finding the moment your UIViewController is popped off a UINavigationController’s stack?

Cheers,
EP.

  • 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-22T02:37:52+00:00Added an answer on May 22, 2026 at 2:37 am

    viewWillDisappear is the appropriate delegate. You will need to add logic within this method if you want to determine if the current view is being popped or a new view is being pushed. That’s been answered here – viewWillDisappear: Determine whether view controller is being popped or is showing a sub-view controller

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

Sidebar

Related Questions

I know this type of question has been asked and answered before but I
This question has been asked before but i still don't understand it fully so
This question has been asked/answered (mostly) before, BUT I've tried three things to stop
I'm sure this question has been asked and answered before, but my Google-fu is
I think probably this question has been asked/answered several times before my post. But
This question has been asked before...but I can't seem to find the exact answer
Sorry if this question has been asked before but I couldn't find a good
This question has been asked many times before but none of the previous ones
I know this question has been asked before, but I've tried everything I could
I know this question has been asked before, but I wasn't able to find

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.