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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T22:21:05+00:00 2026-06-12T22:21:05+00:00

I am looking for UIPageViewController and found this: http://www.ioslearner.com/implementing-uipageviewcontroller-programatically-without-storyboarding/ It’s suspicious. Why does it

  • 0

I am looking for UIPageViewController and found this:
http://www.ioslearner.com/implementing-uipageviewcontroller-programatically-without-storyboarding/

It’s suspicious. Why does it insert an array of just 1 viewController initially.

So I made a program trying to insert 2-10. The program works if I just insert 1 viewController initially. However, if I try to insert 2-10, it doesn’t work.

   [self.containerView addSubview:self.pageViewController.view];
    self.pageViewController.view.frame = self.containerView.bounds;

    NSMutableArray * arrayOfControllers=[NSMutableArray array];
    for (int i = 0; i<1 ; i++) { //if I set this into for (int i = 0; i<10 ; i++) { instead it wouldn't work
        BlankImageViewController *contentViewController = [[BlankImageViewController alloc] init];
        contentViewController.view.frame = self.containerView.bounds;
        [arrayOfControllers addObject:contentViewController];
        //contentViewController.labelContents = [self.modelArray objectAtIndex:0];
    }

    NSArray *viewControllers = @[arrayOfControllers.lastObject];
    viewControllers = [NSArray arrayWithArray:arrayOfControllers]; //If this line is commented it works
    [self.pageViewController setViewControllers:viewControllers
                                      direction:UIPageViewControllerNavigationDirectionForward
                                       animated:YES
                                     completion:nil];

If viewControllers have only one element it works. self.pageViewController.viewControllers will be filled with that 1 element.

if viewControllers have more than one element, then things do not work anymore. self.pageViewController.viewControllers will have empty array.

I wonder why. I am new to UIPageViewController. If you can only fill one UIViewController why ask for an array?

  • 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-12T22:21:07+00:00Added an answer on June 12, 2026 at 10:21 pm

    If you have just one page at a time showing, there is one view controller. If you have two pages at a time showing, there are two view controllers.

    By the way, my book teaches you to get started with Page View Controller:

    http://www.apeth.com/iOSBook/ch19.html#_page_view_controller

    But I haven’t updated it yet for iOS 6 and the new scroll transition style.

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

Sidebar

Related Questions

Looking through the implementation of the Java HashMap here : http://www.docjar.com/html/api/java/util/HashMap.java.html I noticed the
Looking at the following example of an embedded Jetty Example: http://musingsofaprogrammingaddict.blogspot.com.au/2009/12/running-jsf-2-on-embedded-jetty.html The following code
Looking for simple php class routing, like this: http://fatfree.sourceforge.net/page/routing-engine Is there a ready-made solutions?
Looking for feedback on : http://code.google.com/p/google-perftools/wiki/GooglePerformanceTools
Looking through this C++ BigInt library and found the BigInt.cpp file. At the top
Looking at the following SQL fiddle: http://sqlfiddle.com/#!2/962496/1 How could one select all orders from
Looking to do a bit of refactoring... Using NHibernate I have this query currently
Looking for best advice on how to do this: I have an insert like
So what I'm looking to do is have a UIPageViewController that will end up
Looking for something similar to Python's regex sub or subn methods. http://docs.python.org/library/re.html So basically

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.