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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T17:33:24+00:00 2026-05-16T17:33:24+00:00

I have a fairly simple view hierarchy in my iPad app. Window -> RootView

  • 0

I have a fairly simple view hierarchy in my iPad app.

Window -> RootView -> TableView / DetailView

TableView and DetailView are siblings added as subviews (as per a solution to a previous question).
On launch TableView is in front. When you select a cell then method in the app delegate is called which swap them out putting DetailView at the front. A close button in DetailView does the reverse.

Works great.

However…
DetailView contains a UIScrollView, drawn in the .xib
When DetailView comes to the front I have a method that receives details of the contents of the cell whose selection triggered the change. This populates the detail view with label contents and an image.
The labels are simple setters to IBOutlets to the labels in the .xib
The image is sized to the height of the UIScrollView, maintaining aspect ratio. This is done programatically, adding it to an UIImageView which is added to the UIScrollView.

The behaviour I have is fine for Portrait.
When it rotates to Landscape I want to resize the image to match the width of the enclosing UIImageView (and subsequently the enclosing UIScrollView).
I have some great code to actually resize the image (courtesy of a category addition to UIImage from [link text][1]

THE PROBLEM…
Only the RootViewController responds to calls to didRotateToInterfaceOrientation.
I need to send a message from this to a method on the DetailViews controller telling it to resize the image then redraw the associated UIImageView.
Referencing the controller of a subview seems like it should be simple and possibly i’m missing an easy answer.
I tried to use:

[[self.view.subviews objectAtIndex:1] didRotateFromInterfaceOrientation:fromInterfaceOrientation];

and

[self.view viewWithTag:[[self.view.subviews objectAtIndex:1] tag]]

But they both return the view NOT the views controller, and therefore get all angry about selectors when I try to run it.

Can anyone point me the right way?

  • 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-16T17:33:24+00:00Added an answer on May 16, 2026 at 5:33 pm

    The best way to get rotation methods invoked on all your View Controllers is to use an Apple supplied Root View Controller and display any child views through those controllers. These include UINavigationController, UITabBarController, and on the iPad UISplitViewController.

    Navigation events will only get sent to the root view controller, that is the view controller of the view in the main UIWindow of your app. This is not documented, but can be deduced with some work. Apple’s root view controllers seem to be capable of propagating rotation events.

    This can be achieved manually (i.e. without an Apple RVC) but requires keeping track of all your child VCs and using KVC on some readonly properties, which would likely get you kicked out of the app store.

    In your case you could use a navigation controller, hiding the navigation bar and toolbar as appropriate. Initialize it with your current root view controller and add the navigation controller view to the window, instead of your current root view controller. When you need to display the details, simply push the details on the navigation stack. If you don’t like the default animation you can apply your own transition with a little work.

    See below for more details on the navigation controller.

    http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UINavigationController_Class/Reference/Reference.html

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

Sidebar

Related Questions

I'm porting a fairly simple iPhone Navigation based app to a Split View iPad
I have a fairly simple app with two UIViewControllers. One is the main view,
I am trying to build an fairly simple iPad app that requires me to
I have a fairly simple MVC view that allows for dynamic text input that
I have a fairly simple iOS 5 app at this point. A UINavigationController is
I have a fairly simple MFC app that just defines its own sub-classes of
I have a performance issue with a fairly simple ASP.MVC view. It's a log-on
I have a fairly simple iPhone app that downloads a set of UITableView results
I have a fairly simple web2py form with a few validators like, IS_FLOAT_IN_RANGE(...) on
I have a fairly simple question, however the answer seems to elude me. If

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.