EKEventEditViewController 不支持推送到 NavController 吗?请参阅代码 &附加错误
EKEventEditViewController 不支持推送到 NavController 吗?请参阅代码 &附加错误。
我可以很好地呈现 EKEventEditViewController 模态,但是当我尝试通过导航控制器推送时,出现以下错误:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Pushing a navigation controller is not supported'
代码是:
EKEventEditViewController *addController = [[[EKEventEditViewController alloc] initWithNibName:nil bundle:nil] autorelease];
addController.eventStore = self.eventStore;
addController.editViewDelegate = self;
[self.navigationController pushViewController:addController animated:TRUE]; // ERROR HERE
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
EKEventEditViewController 是 UINavigationController 的子类,因此不能将其推送到另一个 UINavigationController。
EKEventEditViewController 应以模态方式呈现。
EKEventEditViewController 类参考
EKEventEditViewController is subclass of UINavigationController, so it can't be pushed to another UINavigationController.
EKEventEditViewController should be presented modally.
EKEventEditViewController Class Ref
如果您正在寻找一些代码来快速启动 iPad-with-popover 实现:
您还需要包含此委托方法,以便在用户完成或取消事件编辑时执行您需要执行的任何操作:
享受吧!
标记
In case you're looking for some code to jumpstart an iPad-with-popover implementation:
You will also want to include this delegate method to do whatever you need to when the user completes or cancels event editing:
Enjoy!
Mark
对于未来的读者:
EKEventEditViewController 是一个 UINavigationController,所以你可以说:
这对我有用,但我不知道你是否可以为 Apple 做到这一点。
For future readers:
EKEventEditViewController is a UINavigationController so you can just say:
This works for me, but I don't know if you can do this for Apple.