xcode 如何禁用Xcode 5自动将xibs升级到iOS7外观

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/17718715/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 03:37:00  来源:igfitidea点击:

How to disable Xcode 5 automatically upgrade xibs to iOS7 appearance

xcodeinterface-builderxibappearancexcode5

提问by Laszlo

If you open an Xcode 4.x project at Xcode 5 and then open a xib at Interface Builder, you will get an alert:

如果你在 Xcode 5 上打开一个 Xcode 4.x 项目,然后在 Interface Builder 上打开一个 xib,你会得到一个警告:

XCode ask to upgrade pre iOS7 xibs to iOS7 only

XCode 要求仅将 iOS7 之前的 xibs 升级到 iOS7

NOTE: I only have the issues with the forced iOS7 appearance, auto layout is still turned off for me.

注意:我只遇到了强制 iOS7 外观的问题,我仍然关闭了自动布局。

And then i accidentally clicked "Alway Upgrade" so Xcode automatically upgrades all my xibs to Xcode 5 and iOS7 prior. But i use Xcode 4.x parallel and it's very annoying to switching back all the xibs when i accidentally open them in Xcode 5.

然后我不小心点击了“始终升级”,因此 Xcode 会自动将我所有的 xib 升级到 Xcode 5 和 iOS7。但是我并行使用 Xcode 4.x,当我不小心在 Xcode 5 中打开所有 xib 时,切换回所有 xib 非常烦人。

Before opened in XCode 5 interface builder:

在 XCode 5 界面生成器中打开之前:

Interface Builder Document with opens in XCode 4.6 and View as 6.1 and earlier

Interface Builder Document with opens in XCode 4.6 and View as 6.1 and更早版本

After opened in XCode 5 interface builder:

在 XCode 5 界面生成器中打开后:

Interface Builder Document with opens in XCode 5.0 and View as 7.0 and later

Interface Builder Document with opens in XCode 5.0 and View as 7.0 and later

I searched in Xcode and on Google to get the way to turn this "feature" off, but i still have no luck about it.

我在 Xcode 和 Google 上搜索以找到关闭此“功能”的方法,但我仍然没有运气。

回答by Dave DeLong

In the File Inspector for the xib (cmd-opt-1), you can change the "Opens in" popup to say "Xcode 4.6". This will revert the document format to one that is compatible with Xcode 4.6, but it also means you will not be able to take advantage of some of the new capabilities in Xcode with regards to xibs.

在 xib ( cmd- opt- 1)的文件检查器中,您可以将“打开方式”弹出窗口更改为“Xcode 4.6”。这会将文档格式恢复为与 Xcode 4.6 兼容的格式,但这也意味着您将无法利用 Xcode 中与 xibs 相关的一些新功能。



If you want to "reset" the "Always upgrade" choice you made, you can do that by resetting that particular user default using Terminal:

如果您想“重置”您所做的“始终升级”选择,您可以通过使用终端重置该特定用户默认值来实现:

defaults write com.apple.dt.xcode IBAlwaysUpgradeAutolayoutDocuments -bool false

回答by Mazyod

I have tried the above solutions, but as other users pointed out, didn't seem to work well... Strangely, after downloading Cocktail for Mac, and cleaning up broken preference as well as caches and other junk (which I did just to maintain my aging Mac) the "Always Upgrade" mistake was finally fixed!!

我已经尝试了上述解决方案,但正如其他用户指出的那样,似乎效果不佳......奇怪的是,在下载Cocktail for Mac并清理损坏的偏好以及缓存和其他垃圾(我只是为了维护我老化的 Mac)“始终升级”错误终于修复了!!

I haven't bought cocktail, honestly, you can use it for free for ten launches or something. So, you can go ahead and get your Mac cleaned up and fix that burden along the way.

鸡尾酒我没买过,老实说,你可以免费使用十次发射什么的。因此,您可以继续清理您的 Mac,并在此过程中解决这个负担。

回答by Mazyod

I modified the Dave DeLong's command to reset the "Always upgrade". Try it.

我修改了 Dave DeLong 的命令以重置“始终升级”。尝试一下。

defaults write com.apple.dt.xcode IBAlwaysUpgradeAutolayoutDocuments -boolean false

回答by russellj

I didn't have luck with either of these commands, but this one worked for me...

这些命令中的任何一个我都没有运气,但是这个对我有用......

defaults write com.apple.dt.xcode IBAlwaysUpgradeAutolayoutDocuments -int 0