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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T01:41:44+00:00 2026-06-13T01:41:44+00:00

When the user is on the first page of a UIPageViewController and tries to

  • 0

When the user is on the first page of a UIPageViewController and tries to go back, I simply return nil. In iOS 5 this works fine. It is causing a crash in iOS 6.

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'The number of view controllers provided (0) doesn't match the number required (1) for the requested transition'

Here is my code. When returning contentViewController instead of nil, it works fine. What should I put instead of nil?

- (UIViewController *)pageViewController:(UIPageViewController *)pageViewController 
  viewControllerBeforeViewController:(UIViewController *)viewController {

    contentViewController = [[ContentViewController_iPhone alloc] init];

    int currentIndex = [self.modelArray indexOfObject:[(ContentViewController_iPhone *)viewController labelContents]];

    if ((currentIndex == 0) || (currentIndex == NSNotFound)) {

        //if on the first page, can't go back
        return nil;

     }

    contentViewController.labelContents = [self.modelArray objectAtIndex:currentIndex - 1];

    return contentViewController;

}
  • 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-13T01:41:45+00:00Added an answer on June 13, 2026 at 1:41 am

    I had the same problem and found out it only happens if I change the delegates of the pageviewcontrollers gestureRecognizers to my own controller (this is done often if you want to cancel paging when a user taps certain areas on the page, e.g. buttons).

    For me it worked to not do this reassignment for iOS 6. This is fine, as iOS handles touches a little bit different. Buttons or your own gesture recognizers on the page will work fine under iOS 6 as they have priority and will cancel paging automatically.

    I hope this helps.

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

Sidebar

Related Questions

This is my first page, which would be my login page. The user types
In my application I first display to the user a disclaimer page as the
I did this: [User.first, User.last].to_xml and got this: <users type=array> <user> <created-at type=datetime>2010-03-16T06:40:51Z</created-at> <id
This there a way to remove this check, when a user first accesses my
Following works fine in shell: >>> from django.contrib.auth.models import User >>> user=User.objects.get(pk=1) >>> user.first_name
On my login web page (i.e. the first page the user hits) I have
I have two pages. Search page is the first page that takes user inputs.
I've finally got the first page of my registration page working. The user has
I have an application whose first page after login presents the user with a
I want to do some work when the user first lands on my page

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.