我一直在网上寻找解决这个问题的方法,但都没有找到一个我能理解的方法。那么问题来了。
我的iOS应用程序在第一次启动时会显示一个UIAlertView。我希望其中一个按钮将用户发送到一个新的viewController以查看一些重要信息。
我已经正确配置了我的UIAlertView,以下是actionSheet的代码:
- (void)alertView:(UIAlertView *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {
if (buttonIndex == 0)
{
//Code to open a new viewController???
}
if (buttonIndex == 1)
{
//User can exit the application if they do not wish to continue
exit(0); }
}
}
我有一个名为webViewViewController的viewController,我希望用户在点击第一个按钮时到达该页面。你们有什么好的想法吗?我已经禁用了ARC,其他一些“解决方案”都会出现错误。
谢谢大家,在这里需要一些指导。
exit(0)
:绝不要使用! 提示:https://dev59.com/HWYq5IYBdhLWcg3woB8W 然后,实例化一个新的UIViewController,可以参考苹果文档。 - Larme