即使我更改了主窗口也不会更改?

发布于 2024-10-22 11:49:48 字数 559 浏览 4 评论 0原文

嘿! 有一个问题让我抓狂!当在 xcode 4 中的界面生成器中进行更改时,我的主窗口不会更改,我已经玩了 2 个多小时试图进行更改,但在构建时它不会更改。当代码中的某些内容发生变化时,它就可以正常工作。 我试图添加到主窗口的是选项卡栏中的一个新选项卡。 请帮我 !

更新:

我的应用程序didfinfishwithoptions 看起来像这样。

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 
    // Override point for customization after application launch. 
    [window addSubview:navigationController.view]; 
    [window addSubview:tabBarController.view];
    [self.window makeKeyAndVisible]; 
    return YES; 
}

Hey!
Have a problem that is driving me crazy! My Main Window will not change when a make changes in interface builder in xcode 4, I have played around for over 2 hours trying to make changes but when a build it does not change. When a change something in the code it works just fine.
The thing I'm trying to add to the main window is a new tab in the tabbar.
Please help me !

UPDATE:

My applictiondidfinfishwithoptions looks like this.

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 
    // Override point for customization after application launch. 
    [window addSubview:navigationController.view]; 
    [window addSubview:tabBarController.view];
    [self.window makeKeyAndVisible]; 
    return YES; 
}

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

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

发布评论

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

评论(1

一生独一 2024-10-29 11:49:48

确保将选项卡添加到分配给主窗口的根视图控制器属性的任何视图。如果将项目拖到窗口本身中,它将不起作用。让事情变得复杂的是,一些 Apple 模板在应用程序委托的 application:didFinishLaunchingWithOptions: 方法中配置根视图控制器,因此请检查那里以查看分配的内容。

更新:

您应该向窗口添加一个视图,并将其他视图添加为子视图。

Make sure that you are adding the tab to whatever view is assigned to the main window's root view controller property. If you drag and item into the window itself it won't work. To complicate matters, some of Apple's templates configure the root view controller in the application delegate's application:didFinishLaunchingWithOptions: method, so check there to see what is being assigned.

UPDATE:

You should add one view to the window and add the other views as subviews.

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