Xcode Interface Builder 显示所有文件的“无选择”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/34373141/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Xcode Interface Builder is showing "No selection" for all files
提问by Marius Waldal
No matter what I've got selected in Interface Builder, the Inspector did apparently not register the selection and only showed "No selection".
无论我在 Interface Builder 中选择了什么,Inspector 显然都没有注册选择,只显示“无选择”。
I tried opening and closing files, restarting Xcode and even rebooting my Mac. No change! What the heck is going on?
我尝试打开和关闭文件,重新启动 Xcode,甚至重新启动我的 Mac。没变!到底他妈发生了什么?
Other projects work just fine. It's just this project...
其他项目工作得很好。只是这个项目...
回答by Marius Waldal
This was driving me crazy for a long time. I found nothing here on Stackoverflow about this, and not by googling either, initially.
这让我发疯了很长时间。我在 Stackoverflow 上一无所获,最初也没有通过谷歌搜索。
Luckily, after googling a couple of different ways, I finally found the simple solution here.
幸运的是,在谷歌搜索了几种不同的方法之后,我终于在这里找到了简单的解决方案。
Snipped from that site:
从该网站截图:
Here's how you can fix it in two steps without even having to restart Xcode:
- Select another file (which isn't an Interface Builder type) in the current tab with the issue.
- Open a new tab and select the Interface Builder file which was having the problem.
以下是您无需重新启动 Xcode 即可分两步修复它的方法:
- 在有问题的当前选项卡中选择另一个文件(不是 Interface Builder 类型)。
- 打开一个新选项卡并选择有问题的 Interface Builder 文件。
Shame on you, Apple!
为你感到羞耻,苹果!
回答by Tim Newton
In XCode 8.3, the preferred solution doesn't appear to work. My solution, similar to travdu, was to click the "Show the version editor" button (the two arrows pointing left and right), then back to the "Show the Standard editor". Doing that fixed it for me.
在 XCode 8.3 中,首选解决方案似乎不起作用。我的解决方案与 travdu 类似,是单击“显示版本编辑器”按钮(左右两个箭头),然后返回“显示标准编辑器”。这样做为我修复了它。
回答by iHarshil
MOST SIMPLE SOLUTION:
最简单的解决方案:
(For each of those who has tried all the above options like me, try this once):
(对于像我一样尝试过上述所有选项的每个人,请尝试一次):
Switch to the LaunchScreen.storyboardfrom your Main.storyboard
See if you can access all the Inspectors on right side in LaunchScreen.storyboard.
切换到LaunchScreen.storyboard从Main.storyboard
看看您是否可以访问LaunchScreen.storyboard右侧的所有检查器。
if yes,
如果是,
- Switch back to Main.storyboard
- 切换回 Main.storyboard
Always work for me! Hope this also help to someone. Thanks!
永远对我来说有效!希望这也对某人有所帮助。谢谢!
EDIT 1:
编辑 1:
Above solution works for xib onlyprojects too.
以上解决方案也适用于仅适用于xib 的项目。
回答by travdu
回答by Muhammad Zaheer
After trying above all tricks, I just made a copy somewhere of the file which has the issue and deleted that file from Xcode. Opened it directly from there and file seemed good. Dragging it to the project solved this heinous issue.
在尝试了所有技巧之后,我只是在有问题的文件的某个地方复制了一个副本,然后从 Xcode 中删除了该文件。从那里直接打开它,文件看起来不错。将它拖到项目中解决了这个令人发指的问题。
回答by novice
Open the file in the new tab and it will work fine
在新选项卡中打开文件,它会正常工作
回答by cosmo
If the above solutions don't work, try adding an object (e.g a label) onto the main storyboard. Brought all the inspectors back for me with xcode 7.3
如果上述解决方案不起作用,请尝试在主情节提要上添加一个对象(例如标签)。用 xcode 7.3 为我带回了所有检查员
回答by jingyul
I just experienced that the "Utility Area doesn't display anything" symptom, with Xcode version 9.0. Thanks for the tips! In my case, after I closed all the files displayed in the Assistant Editor, you would think it is totally not related, but it worked again! (Before that, I tried to restart XCode, restart iOS, none of them was working.)
我刚刚在 Xcode 9.0 版中遇到了“实用程序区域不显示任何内容”的症状。感谢您的提示!就我而言,在我关闭助手编辑器中显示的所有文件后,您会认为它完全不相关,但它又起作用了!(在此之前,我尝试重新启动 XCode,重新启动 iOS,它们都不起作用。)
回答by Kejsi Struga
I just run into the same issue. And I see there is solution already but it could help others: make sure you are in the Main.storyboardand not in the LaunchScreen.storyboard
我只是遇到了同样的问题。而且我看到已经有解决方案,但它可以帮助其他人:确保您在Main.storyboard 中而不是在LaunchScreen.storyboard 中
Hope it helps!
希望能帮助到你!
回答by Anton Kashpor
The bug is weird. And all answers didn't help me. The following steps were useful for me:
这个错误很奇怪。所有的答案都没有帮助我。以下步骤对我有用:
- go to project file.
- Click on the button near "Launch Images Source"
- 转到项目文件。
- 单击“启动图像源”附近的按钮
After that Xcode shows assets in the proper way.
之后 Xcode 以正确的方式显示资产。