没有加载iOS开发所需的ViewController和View

发布于 2024-11-19 19:34:01 字数 837 浏览 0 评论 0原文

我在 xCode 中创建了一个基于 Windows 的应用程序。我的问题是基于Windows的应用程序的目的是什么。现在,我想加载自定义控制器,但每当我运行应用程序时,都会执行 appname_iphone 内的任何内容。在我的 AppDelegate.m 中,我正在执行以下操作:

-(void) applicationDidFinishLaunching:(UIApplication *)application
{
    [_window addSubview:jogViewController.view];
    [_window makeKeyAndVisible];
}

但是 jogViewController 从未加载。 JogBuddyAppDelegate_iPhone 始终执行以加载视图。

更新 1:

在界面生成器中,我单击了 MainWindow_iPhone.xib,然后单击了 App Delegate,并将自定义类更改为 JogViewController。现在,当我运行该应用程序时,出现以下错误:

2011-07-12 13:06:19.925 JogBuddy[3139:207] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<JogViewController 0x5a067e0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key window.'
*** Call stack at first throw:

I created a windows based application in xCode. My question is that what is the purpose of windows based application. Now, I want to load my custom controller but whenever I run the application anything inside the appname_iphone is executed. Inside my AppDelegate.m I am doing the following:

-(void) applicationDidFinishLaunching:(UIApplication *)application
{
    [_window addSubview:jogViewController.view];
    [_window makeKeyAndVisible];
}

But jogViewController is never loaded. The JogBuddyAppDelegate_iPhone is always executed which loads the view.

UPDATE 1:

In the interface builder I clicked on the MainWindow_iPhone.xib and then I clicked on the App Delegate and changed the custom class to JogViewController. Now, when I run the application I get the following error:

2011-07-12 13:06:19.925 JogBuddy[3139:207] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<JogViewController 0x5a067e0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key window.'
*** Call stack at first throw:

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

洛阳烟雨空心柳 2024-11-26 19:34:01

您是否将视图控制器拖入 MainWindow.xib 并将其链接到您在应用程序委托中定义的视图控制器?

Did you drag a view controller in in MainWindow.xib and link it to the view controller you defined in the app delegate?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文