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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T04:40:04+00:00 2026-05-19T04:40:04+00:00

I was doing some testing and debugging of my Iphone app today and encountered

  • 0

I was doing some testing and debugging of my Iphone app today and encountered some strange behaviour.

In my MainView I have two modal views and when showing one of these using presentModalViewController I noted that the viewDidUnload method of my MainView was called while it was not happening when showing the other. It was the same case for the viewDidLoad method (of MainView) while closing the subviews.

I inspected the two methods for opening and closing the subviews and the only difference I found was in the modalTransitionStyle. In the one which did activate viewDidUnload/viewDidLoad I was using UIModalTransitionStyleFlipHorizontal and in the other UIModalTransitionStyleCrossDissolve. I then started experimenting by swapping the two styles and by using the other transition styles as well and I found that this was indeed what was causing the different behaviour. In fact when using UIModalTransitionStyleFlipHorizontal the viewDidUnload/viewDidLoad methods of the “parent” view controller were always called while it never happened for any of the other transition styles.

My question is now it this is supposed to behave like this, and if not which behaviour is then the correct one. Are the unload and load methods supposed to get called when showing and closing an modal view or not.

Also, could someone else confirm or disconfirm this behaviour?

Thanx

PS. the viewDidLoad method of the two called view controllers gets called every time. Just to clarify 🙂

  • 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-19T04:40:05+00:00Added an answer on May 19, 2026 at 4:40 am

    Are the unload and load methods supposed to get called when showing and closing an modal view or not.

    The behavior should depend on the current memory situation. If memory is low, the system will send memory warnings to all view controllers. A view controller whose view is not currently on screen will react on the memory warning by unloading its view (which will cause a reloading of the view when it comes on screen again, obviously).

    So depending on the memory situation of the device and the memory requirements of the modal view controller you are displaying, the unload/load behavior should vary. It should not depend on the modalTransitionStyle IMO.

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

Sidebar

Related Questions

I am doing some testing in my iPhone app and I get this error:
I am doing some initial testing for a Rails app which will be deployed
I am doing some performance testing and have found that SQL seems to be
Early on I was doing some debugging and testing using the chrome dev tools(known
I have been doing some testing with the following code to try and work
I'm doing some testing with WCF and we currently have the following Server setup
Hi I was doing some testing earlier and my app was running just fine.
I have been doing some testing whilst using Jquery UI datepicker and have found
I have been doing some testing with the differences between JavaScript and PHP regular
I have been doing some testing with ObjectiveResource (iOS->Rails bridge). Things seem to work,

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.