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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T04:50:30+00:00 2026-05-23T04:50:30+00:00

Before resorting to custom flags I wanted to check this with you people. Is

  • 0

Before resorting to custom flags I wanted to check this with you people.

Is there a built-in way to determine in viewWillAppear: or viewWillDisappear: whether the UIViewController is ‘newly pushed’ onto a UINavigationController’s stack, or whether the navigation controller has popped another view off, revealing this one? I want to execute some one-off code the first time the view appears. Because the self.bounds property needs to be set, the viewDidLoad: method is not the right place.

I was hoping to get some results with what I’m using to determine something similar on viewWillDisappear:, but on the first viewWillAppear: the index is already set to 1:

[self.navigationController.viewControllers indexOfObject:self]

So this is a useless snippet. Any ideas?

  • 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-23T04:50:31+00:00Added an answer on May 23, 2026 at 4:50 am

    The way I handle this is as follows… Have a flag which is initially set to false, when you push a child view controller onto your navigation controller set this flag to true, no on the viewDidAppear if the flag is false then it is the initial load if true then it is being returned to from a child controller popping off the navigation stack.

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

Sidebar

Related Questions

Before Django 1.0 there was an easy way to get the admin url of
Before I start writing my own custom classes, I was wondering if there was
Before I throw something ugly together I thought this would be a good one
Before the switch and in all apps on this passenger that run rails 2.0
Is there any way in SSRS2008 to deploy multiple instances of the ReportServer running
I am wondering if there is an easy way to calculate the text extent
Before answering, it is not as easy question as you might have thought about
Before you start flaming, I'm going to tell you that I am trying to
Before I roll my own Queue using NSMutableArray , I'd like to know if
Before I begin I'll freely admit it's something in my code but it's not

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.