I am using Xamarin IOS and trying to implement a UIPageViewController with some existing UITableViewControllers in my application. However, it throws this error whenever I try to mount a UIPageViewController with a UITableViewController:
MonoTouch.Foundation.MonoTouchException: Objective-C exception. Name: NSInternalInconsistencyException Cause: The view manager does not control the open view; layer =; contentOffset: {0, 0}> at at (wrapper managed-to-native) MonoTouch.UIKit.UIApplication: UIApplicationMain (int, string [], intptr, intptr) in MonoTouch.UIKit.UIApplication.Main (System.String [] args, System.String mainClassName, System.String delegateClassName) [0x0004c] in /Developer/MonoTouch/Source/monotouch/src/UIKit/UIApplication.cs:38 in App.IOS7.Application.Main (System.String [] args) [0x00008] in / Users / liam / Projects / Project 1 / App.IOS7 / Main.cs: 16
There is no specific line of code that it refers to, it just goes to the application delegate.
Here is an example of how the code creates a UIPageViewController:
var ctrl = new UIPageViewController (UIPageViewControllerTransitionStyle.Scroll, UIPageViewControllerNavigationOrientation.Horizontal, UIPageViewControllerSpineLocation.None);
var rc = new RaceEventViewController (null);
ctrl.SetViewControllers (new UIViewController[] { rc }, UIPageViewControllerNavigationDirection.Forward, true, null);
ctrl.DataSource = new RaceEventDataSource (list);
vc.NavigationController.PushViewController (ctrl, true);
?