View *view1 = [[View alloc] init];
[self presentModalViewController:view1 animated:YES];
Run Code Online (Sandbox Code Playgroud)
上面的代码在连接到a时有效UIButton.通过将应用程序放入viewDidLoad:方法中,它无法在启动应用程序时起作用.我希望在发布时运行它.
下面是这样的情况:我有一个类MainView(它是一个UIViewController)并从中调用一个UIActionSheetDelegate类.我想使用presentViewController方法,但以下代码不起作用(当前在ActionSheet类中调用):
[self presentViewController:myViewController animated:YES];
Run Code Online (Sandbox Code Playgroud)
关于从(MainView或ActionSheetDelegate)调用方法的地方我有点困惑.
提前致谢.
uiviewcontroller uiactionsheet presentmodalviewcontroller ios