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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:27:33+00:00 2026-06-17T09:27:33+00:00

I am trying to understand Apple’s default template for a Page-based application. That template

  • 0

I am trying to understand Apple’s default template for a Page-based application. That template shows a sort of calendar with one page for each month of the year.

When compiling the template without any changes, I noticed something odd. When the app launches, it displays in portrait mode, and when – after flipping through some of the pages (say, to June) – you change the rotation, it reloads in landscape mode showing two pages, BUT STARTING WITH JANUARY. This happens only once, though. On subsequent orientation changes, it then jumps to the correct “currentViewController”.

The code for this seems to come from the RootViewController file, specifically

UIViewController *currentViewController = self.pageViewController.viewControllers[0];

And frankly, it seems to be ignored for the first orientation change.

I am trying to understand why?

  • 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-17T09:27:34+00:00Added an answer on June 17, 2026 at 9:27 am

    I had to deal with the same issue when updating an App to be iPhone 5 friendly. When compile with iOS 6 sdk, the problem appear on iOS 6, but not on iOS 5. It happens only when entering the PageViewController from landscape orientation.

    A workaround :

    Create a property to save the current state in @interface section of your .m :

    @property (strong, nonatomic) NSArray *viewControllersSave;
    

    Save the viewControllers in willRotateToInterfaceOrientation :

    (UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
        // some code here...
        self.viewControllersSave = self.pageViewController.viewControllers;
    }
    

    Use the saved property instead of the PageViewController property in spineLocationForInterfaceOrientation.

    - (UIPageViewControllerSpineLocation)pageViewController: (UIPageViewController *)pageViewController
                       spineLocationForInterfaceOrientation: (UIInterfaceOrientation)orientation
    {
       // some code
       NSArray *viewControllers = @[self.viewControllersSave[0]];
       [self.pageViewController setViewControllers:viewControllers
                                direction:UIPageViewControllerNavigationDirectionForward
                                animated:YES
                                completion:NULL];
    
    return UIPageViewControllerSpineLocationMin;
    }
    

    This could be a possibility to avoid the problem BUT you should submit a bug report to Apple to avoid such a workaround for later usage.

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

Sidebar

Related Questions

So I'm building a document-based application in Cocoa and trying to understand NSManagedObjectContext. I've
Trying to understand the options for will_paginate's paginate method: :page — REQUIRED, but defaults
I'm trying to understand UIScrollView's contentInset and contentOffset properties. Apple's docs frequently refer to
Trying to understand the relationship between UIView and CALayer. I read Apple documentation but
I'm trying to understand how to get my iPhone application working with RegexKitLite ,
I'm trying to debug an application that download a lot of resources from internet.
I am trying to understand Referring to Instance Variables from Apple guide but having
I am trying to understand quartz 2d coordinate system, Currently I am reading Apple
I am trying understand ViewModels deeper and I have read many articles and blogs
Trying to understand what's the correct way of implementing OpenID authentication with Spring Security.

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.