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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T10:15:38+00:00 2026-05-30T10:15:38+00:00

So I followed the following tutorial on creating custom views associated with device orientations:

  • 0

So I followed the following tutorial on creating custom views associated with device orientations:

http://www.theappcodeblog.com/2011/03/30/orientation-change-tutorial-change-the-view-when-the-orientation-changes/

To summarize the article, the author is able to generate custom views for landscape and portrait orientations by pointing to a new top level view in an XIB file upon detecting a device rotation.

Therefore, I took a complicated view hierarchy (many buttons, sliders, views within views), duplicated everything at the top level to create the landscape view. Then created custom arrangements for the landscape view. In a method where my code detects a landscape orientation, my code points to the top of the landscape hierarchy and portrait when detecting portrait.

This works, except all the IBOutlets (UIView, UIButton, etc) in landscape hierarchy are still referencing their equivalent objects in portrait view hierarchy. I do a lot of special processing on these UI elements during the run time so I require IBOutlets and not just IBActions. I found that my copied UI elements in the landscape view can point to the same IBActions, but they can not share IBOutlets with the ones in the portrait hierarchy.

Do I have to duplicate all the objects and have my code manage everything (figure out which objects to use)?

  • 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-30T10:15:39+00:00Added an answer on May 30, 2026 at 10:15 am

    Here’s one approach that may suit you.

    If you load the landscape nib right at the time when you need to swap in the landscape view, you can pass your view controller as the nib file’s owner, and the nib loader will overwrite your view controller’s outlets based on the connections in the landscape nib.

    And when you need to swap in the portrait view again, load the portrait nib and pass the view controller as the file’s owner. The nib loader will again overwrite your view controller’s outlets, this time based on the connections in the portrait nib.

    You should lazily create a UINib object for each of the nibs the first time that nib is needed, and keep them around to speed up loading on subsequent rotations.

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

Sidebar

Related Questions

I followed the example http://www.dealtaker.com/blog/2010/02/25/kohana-php-3-0-ko3-tutorial-part-5/ I get the following error: ErrorException [ Notice ]:
I'm using Ubuntu 10, python 2.6.5 I'm following this tutorial: http://www.djangobook.com/en/2.0/chapter02 I followed all
I followed the instructions in the Android WebView tutorial (at http://developer.android.com/resources/tutorials/views/hello-webview.html ). When I
I am following an intro tutorial http://www.linuxinsight.com/files/alp/alp-ch01-getting-started.pdf . I have created the source files
I followed the following tutorial to build a multilingual webpage using php arrays: http://bytes.com/topic/php/answers/880915-how-develop-multi-lingual-websites-php
I followed the following tutorial to help me create a datagrid ( http://www.asp.net/web-pages/videos/aspnet-razor-pages/displaying-data-in-a-grid ),
I am learning .net and writing a service by following the tutorial below http://www.beansoftware.com/NET-Tutorials/Create-Windows-Services.aspx
I am following the symfony2 tutorial http://www.slideshare.net/weaverryan/symfony2-get-your-project-started . On slide 22 i must perform
I need help, I followed the following tutorial on setting up my project. http://lwjgl.org/wiki/index.php?title=Setting_Up_LWJGL_with_NetBeans
I've just followed the Railscast tutorial: http://railscasts.com/episodes/262-trees-with-ancestry Is it possible to paginate results from

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.