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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:23:40+00:00 2026-05-29T10:23:40+00:00

So, I’m trying to use the UIPageViewController with a custom application workflow, but I’m

  • 0

So,

I’m trying to use the UIPageViewController with a custom application workflow, but I’m implementing it exactly as recommended in the docs.

 self.pageViewController = [[[UIPageViewController alloc]  initWithTransitionStyle:UIPageViewControllerTransitionStylePageCurl
                                                            navigationOrientation:UIPageViewControllerNavigationOrientationHorizontal options:nil] autorelease]; 

//calls setViewControllers:direction:animated:completion with valid UIViewControllers
[self setupPagesWithIndex:0]; 

self.pageViewController.delegate = self;
self.pageViewController.dataSource = self;

self.view.frame = CGRectMake(0, 0, 1024, 768);

self.pageViewController.view.backgroundColor = [UIColor grayColor];

Here is where I set the view controllers…

- (void) setupPagesWithIndex:(NSInteger) index
{
    UIViewController* vc1 = [self uicontrollerForIndex:index];
    UIViewController* vc2 = [self uicontrollerForIndex:index+1];
    [self.pageViewController setViewControllers:[NSArray arrayWithObjects:vc1,vc2, nil] 
                                      direction:UIPageViewControllerNavigationDirectionForward 
                                       animated:NO 
                                     completion:nil];
}

The only thing that appears on screen is the grey background color. I have verified that the UIViewControllers are valid, have good frames and I even gave them background colors just so I could see something

This is how I’m adding the UIPageViewController to the screen:

 [[self rootViewController] addChildViewController:self.pageViewController];
 [[self rootViewController].view addSubview:self.pageViewController.view];

[self rootViewController] returns the application’s rootViewController.

The view is definitely visible, because I can see the backgroundcolor I apply… however, the UIPageViewController is just totally blank!

I implemented all of the datasource and delegate methods and adopted the protocols; they never even get called!

My question is; what are all of the requirements for the UIPageViewController to display pages when you do everything programmatically?

edit #1, per request:
This class is a controller for UIPageViewController within my own application-building framework. I’m giving the controller two ways of building a page right now — from an image name or from a kind of asset key. In either case, it ultimately returns a view which I wrap with a UIViewController.

I create the view controller with

UIViewController* vc = [[[PageTest alloc] initWithNibName:@"PageTest" bundle:nil] autorelease];

‘PageTest’ is just a UIViewController with a corresponding nib, which is blank except for the auto-generated settings. I then add my custom view as a subview to this view controller. This is what comes back from uicontrollerForIndex:

edit #2, further discovery

I’ve found a way to show the book flipper; if I only initialize it with one view controller it will show the book flipper. It doesn’t matter if the two view controllers are different classes entirely; if I setViewControllers with two of them then nothing shows.

if I return UIPageViewControllerSpineLocationMid in the delegate method

- (UIPageViewControllerSpineLocation)pageViewController:(UIPageViewController *)pageViewController spineLocationForInterfaceOrientation:(UIInterfaceOrientation)orientation

Then upon rotation, the app will crash without an identifiable backtrace.

  • 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-29T10:23:42+00:00Added an answer on May 29, 2026 at 10:23 am

    With the,

     - (UIPageViewControllerSpineLocation)pageViewController:(UIPageViewController *)pageViewController spineLocationForInterfaceOrientation:(UIInterfaceOrientation)orientation
    

    method, you must call setViewControllers before returning the spineLocation.

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

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
Seemingly simple, but I cannot find anything relevant on the web. What is the
I have a French site that I want to parse, but am running into
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I need to clean up various Word 'smart' characters in user input, including but

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.