4

I am using Xamarin IOS and trying to implement a UIPageViewController with some existing UITableViewControllers in my app. However it is throwing this error whenever I try to crreate the UIPageViewController with the UITableViewController:

MonoTouch.Foundation.MonoTouchException: Objective-C exception thrown. Name: NSInternalInconsistencyException Reason: No view controller managing revealed view ; layer = ; contentOffset: {0, 0}> at at (wrapper managed-to-native) MonoTouch.UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr) at MonoTouch.UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0004c] in /Developer/MonoTouch/Source/monotouch/src/UIKit/UIApplication.cs:38 at App.IOS7.Application.Main (System.String[] args) [0x00008] in /Users/liam/Projects/Project1/App.IOS7/Main.cs:16

There isn't a specific line of code referenced it just goes to the Application Delegate.

Here is an example of how the code creates the 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);

Why is this error crashing my app and how can I fix it?

startupsmith
  • 5,554
  • 10
  • 50
  • 71

0 Answers0