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

  • Home
  • SEARCH
  • 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 8145211
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T13:35:31+00:00 2026-06-06T13:35:31+00:00

I have added one view controller to my first view controller as aa subview

  • 0

I have added one view controller to my first view controller as aa subview by using self.view add subview:secondview now when I’ll rotate the device

- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration;

method calls for only parent view Now I also want to call that method for child view controller so i can make required changes in child view controller also.
So for that what I have to do??

-Thanks in advance.

  • 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-06T13:35:32+00:00Added an answer on June 6, 2026 at 1:35 pm

    In WWDC 2011 Session 102 on view controller containment, they mention that a failure to keep one’s view controller hierarchy synchronized with the view hierarchy can result in rotation events problems. They explicitly point out that if you just grab a view controller’s view and add it as a subview of the main view, without adding the controller, itself, to the view controller hierarchy, you won’t get these rotation events. In that WWDC session, they also suggest that if you want to “future-proof” your app, you’ll want to manage view controllers properly.

    From a pragmatic perspective, this means that as you go from one view to another, that you really should be transitioning the view controllers. Most commonly this means using pushViewController or presentViewControllerAnimated (formerly presentModalViewController). Or you can use view controller containment (see that WWDC session or look at the very brief comments about containment in the UIViewController Class Reference). But don’t just grab the view from another view controller and just add it as a subview of the current view.

    If you pursue view controller containment, at a minimum, you could add your child view’s controller to the hierarchy via:

    [self addChildViewController:childController];
    [childController didMoveToParentViewController:self];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have one view controller in which I have added UIScrollView & UIImageView programatically.
am using the application in this link http://www.jeasyui.com/tutorial/app/crud2.php .I have added one more column
In my view of my iPhone app, I have added one sub view, which
I have a simple Rails 3 app: no models, one view and one controller
I have added the view of my view controller as a property to the
I have added prototype cell in one of the controllers that is part of
I have a created a custom cell and added one label and Image, I
I have an existing project that consumes web services. One was added as a
I have a client who has one webpage with customized routes added in global.asax
I have 5 CALayers each one is a property. Say I added 3 of

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.