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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T16:45:59+00:00 2026-06-14T16:45:59+00:00

I have a custom navigation implemented but I have a problem. After I pop

  • 0

I have a custom navigation implemented but I have a problem.

After I pop a UIViewController, I manually call viewWillDisappear, but for some reason it gets called again when I call removeFromSuperview for that UIViewController's UIView.

How can I stop that from happening? This happens for iOS 6, I am sure it doesn’t for iOS 4, I haven’t tested for iOS 5. I am already using:

 - (BOOL)automaticallyForwardAppearanceAndRotationMethodsToChildViewControllers {
     return NO;
}

but it doesn’t help.

I am not using dismissViewControllerAnimated. I have implemented a custom Navigation Controller, I use my own stack, and “Push” and “Pop” the UIViewControllers by animating their view on and offscreen, and I call viewWillAppear and viewWillDisappear manually. The problem is that after I “Pop” a UIViewController off screen, when I call [currentViewController.view removeFromSuperView] the viewWillDisappear method gets called, and I don’t want that, as I already called it.

Any help would be appreciated.

  • 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-14T16:46:00+00:00Added an answer on June 14, 2026 at 4:46 pm

    Ok, I found a solution. The problem was that I was calling [controller.view removeFromSuperview] and I noticed in the call stack that [UIViewcontroller _setViewState:animated] was called. So I did a small hack:

    UIView *view = controller.view;
    controller.view = nil;
    [view removeFromSuperView];
    [controller release];
    

    Now, viewWillDisappear isn’t called anymore when call [view removeFromSuperview]. Hope this will help someone.

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

Sidebar

Related Questions

Have created a custom navigation menu in wordpress that has some pages and some
i am facing a new problem. I have custom navigation controller in my application.
I have a custom navigation menu for my SharePoint intranet web application which is
I have a custom UINavigationController that draws a custom background. That navigation controller is
I have created a flexible navigation bar in my app that will show custom
I am developing a navigation based application and I have a custom titleView and
I have jqgrid and in that I have one custom navigation button to export
I already applied a custom order for the toplevel navigation of my page, but
I have my main program with MainAppDelegate.h,MainAppDelegate.m . I have created two custom navigation
I have a very tricky problem and after long searching (google, stackoverflow, ...) i

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.