Search code examples
iphoneiosuinavigationcontrollernavigationcontrollerekeventkit

does EKEventEditViewController not support being pushed to a NavController? See code & error attached


does EKEventEditViewController not support being pushed to a NavController? See code & error attached.

I can present the EKEventEditViewController modally fine, BUT when I try to push via the nav controller I get the following error:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Pushing a navigation controller is not supported'

Code is:

EKEventEditViewController *addController = [[[EKEventEditViewController alloc] initWithNibName:nil bundle:nil] autorelease];
addController.eventStore = self.eventStore;
addController.editViewDelegate = self;

[self.navigationController pushViewController:addController animated:TRUE];   // ERROR HERE

Solution

  • EKEventEditViewController is subclass of UINavigationController, so it can't be pushed to another UINavigationController.

    EKEventEditViewController should be presented modally.

    EKEventEditViewController Class Ref