I’m on Monotouch 5.2.6 and iOS SDK 5.0.1.
I have a UIPageViewController that is a child container of another view controller.
It is created like this:
pageViewController = new UIPageViewController (UIPageViewControllerTransitionStyle.PageCurl, UIPageViewControllerNavigationOrientation.Horizontal, UIPageViewControllerSpineLocation.Min);
this.AddChildViewController (pageViewController);
pageViewController.DidMoveToParentViewController (this);
this.viewCurrentMode.AddSubview (pageViewController.View);
If I rotate the device (Simulator), I get this exception in UIApplication.SendEvent():
Objective-C exception thrown. Name: NSInternalInconsistencyException
Reason: The number of provided view controllers (1) doesn’t match the
number required (2) for the requested spine location
(UIPageViewControllerSpineLocationMid)
The spine location is NOT “mid” but “min”. Any ideas?
True, you have initialized the UIPageViewController with “Min” as spine location. However, you need to implement a delegate for your page controller and override the
GetSpineLocationmethod:Or, assign a method to its
GetSpineLocationproperty (MonoTouch heaven! ):Still, it looks a bit unexpected behavior. I assume that the default implementation of the native
pageViewController:spineLocationForInterfaceOrientation:method returns “Mid” when the device rotates to landscape (although could not find info in Apple docs). Anyway, you must override the above method to get it right.