无法在 IB 中打开选项卡栏控制器
我刚刚开始学习使用 xcode 构建 iPhone 应用程序。
我正在慢慢掌握基础知识,但我在 Interface Builder 中遇到了一个问题。
当我使用选项卡栏应用程序模板创建新项目时,我似乎无法使用 main.xib
中的选项卡栏控制器执行任何操作。当我双击该文件时,IB 可以正常打开,但没有窗口可以向视图添加/删除项目。如果我从库中拖动第二个选项卡栏控制器,它会打开一个窗口来编辑视图,但不会执行任何其他操作,因为它未连接。如果我关闭编辑器窗口并双击 IB 中的新选项卡栏控制器图标,它会重新打开它,但当我双击它时拒绝打开原始(已连接)的选项卡栏控制器。
我非常乐意从头开始使用基本的 Window 应用程序,但我找不到任何资源来让我开始使用不简单使用 xcode 模板的选项卡栏控制器!
我将不胜感激任何人可以提供的帮助。
I've only just started learning to build iPhone apps using xcode.
I'm slowly getting the basics, but I've come across a problem in Interface Builder.
When I create a new project using the Tab Bar Application template, I can't seem to do anything with the Tab Bar Controller in main.xib
. When I double click the file, IB opens up fine, but there is no window to add/remove items to the view. If I drag a second Tab Bar Controller from the library, it opens up a window to edit the view, but does nothing else as it isn't connected. If I close the editor window and double click the new Tab Bar Controller icon in IB, it opens it back up but refuses to open up the original (connected) one when I double click that.
I'm more than happy to start completely from scratch with a basic Window application, but I can't find any resources to get me started with Tab Bar Controllers that don't simply use the xcode template!
I'd appreciate any help anyone can give.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
正如 pat 建议的那样,将 TabBarController 移动到 MainWindow.xib 中的窗口上方解决了我的问题。奇怪的是,当显示 TabBarController 窗口时,如果我将 .xib 中的 TabBarController 移回到 Window 项下方,TabBarController 窗口就会消失。
Moving the TabBarController above the Window in the MainWindow.xib solved the problem for me, as pat suggested. The weird thing is while the TabBarController window is displayed, if I move the TabBarController in the .xib back below the Window item, the TabBarController window disappears.
我想我找到了解决这个问题的方法:
当您双击 MainWindow.xib 时,Interface Builder 打开,并且没有用于添加/删除项目的窗口。
将“tabbarcontroller”项移到“window”项之前,然后双击“tabbarcontroller”:您可以看到带有选项卡栏的窗口。
我希望它对你有用!
I think I found a solution, to this problem:
When you double click on MainWindow.xib, Interface Builder open up and there is no window to add/delete items.
Move the item "tabbarcontroller" before the item "window", then double click on "tabbarcontroller": you can see the window with the tab bar.
I hope it works for you!
你没有疯!我一整天都在为这个问题苦苦挣扎。我第一次遇到这种情况时,选项卡栏控制器窗口最终在库窗口后面打开,我以为我一直错过它。但是当我后来遇到问题时,窗口并没有隐藏,我所做的任何事情都无法将其恢复。最终(后来删除了许多项目和新项目),我发现如果您缓慢双击选项卡栏控制器图标,它就会弹出。
You aren't crazy! I've been struggling with this problem all day. The first time it happened to me, the Tab Bar Controller window eventually opened behind the library window and I thought I had missed it that entire time. But when I had the problem later, the window was not hidden and nothing I did would bring it back. Eventually (many deleted and new projects later), I discovered that if you give the Tab Bar Controller icon a SLOW double click, that it would pop up.
呃,在删除并重新创建项目几次、打开不同的
.xib
文件、单击内容、移动内容之后,我认为我发现我无法使用该窗口open 实际上可能是在库窗口和检查器窗口后面打开的,它们总是位于编辑窗口的顶部。我感到相当尴尬,但我要为自己辩护,我是一个 20 年的 Windows 用户和一个 2 周的 Mac 用户:)
Erm, after deleting and recreating the project a few times, opening different
.xib
files, clicking things, moving things, I think I have discovered that the window I couldn't open might have actually been open behind the library window and the inspector window which both always sit on top of the editing window.I am suitably embarrassed but in my defense I'm a 20-year windows user and a 2 week mac user :)
好的,我正在开发我的第二个 iPhone 应用程序,从一个新的标签栏应用程序开始,但我遇到了同样的问题!这太令人沮丧了!上次缓慢的双击起作用了,但这一次却不起作用。
我最终要做的是将一个新的选项卡栏控制器拖到主窗口,并对其进行配置(只需使用已存在的选项卡栏控制器中的相同配置)。它就像一个魅力!
Okay, so here I am working on my second iPhone app, starting over with a new tab bar application, and I have the SAME EXACT PROBLEM! This is so frustrating! Last time the slow double clicked worked, but this time it didn't.
What I finally wound up doing was dragging a new Tab Bar Controller over to the main window, and configuring that (just use the same exact configurations from the Tab Bar Controller that is already there). It worked like a charm!