正确使用 UIApplicationMain
我决定以编程方式加载我的视图,因此输入:
int ret = UIApplicationMain(argc, argv, nil, nil);
行不通。不过,我确实有一个 ViewController 和一个 AppDelegate。使用 ViewController 和 AppDelegate 时 UIApplicationMain 的正确用法是什么。
PS 我没有使用 XCode 或 Interface Builder,我正在工具链上进行开发。
I have decided to load my views programmatically, so putting:
int ret = UIApplicationMain(argc, argv, nil, nil);
Would not work. I do have a ViewController and an AppDelegate, though. What would be the proper use of UIApplicationMain to use a ViewController and an AppDelegate.
PS I am NOT using XCode or Interface Builder, I am developing on the toolchain.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
此函数声明为
由于您没有子类化 UIApplication,因此将
nil
传递给第三个参数。但是你有一个自定义的 UIApplicationDelegate。因此将其类名传递给第四个参数。This function is declared as
Since you did not subclass UIApplication, pass
nil
to the 3rd argument. But you have a custom UIApplicationDelegate. So pass its class name to the 4th argument.