xcode 编译 Mac OS X 10.8 之前的目标时 Base.lproj/MainMenu.xib 不可用

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

Base.lproj/MainMenu.xib is not available when compiling for targets before Mac OS X 10.8

xcodecocoawarningsxcode5

提问by Almas Adilbek

I'm very new to Cocoa development.
I've just created Cocoa project in Xcode 5. I changed Deployment Targetfrom 10.8 to 10.6. Now I get this warning:

我对 Cocoa 开发很陌生。
我刚刚在Xcode 5 中创建了 Cocoa 项目。我将部署目标从 10.8更改为 10.6。现在我收到这个警告:

path-to-my-project/Base.lproj/MainMenu.xib is not available when compiling for targets before Mac OS X 10.8

编译 Mac OS X 10.8 之前的目标时,path-to-my-project/Base.lproj/MainMenu.xib 不可用

Is it normal behavior? What should I do?

这是正常行为吗?我该怎么办?

回答by Mark Szymczyk

Your project is using base internationalization, which makes translating your app to other spoken languages easier. Base internationalization is supported on Mac OS X 10.8 and later, which is why you are getting the warning when you changed the deployment target to 10.6.

您的项目正在使用基本国际化,这使得将您的应用程序翻译成其他口语变得更加容易。Mac OS X 10.8 及更高版本支持基本国际化,这就是将部署目标更改为 10.6 时收到警告的原因。

There are two ways to get rid of the warning. First, you can set the deployment target to 10.8. Second, you can turn off base internationalization. Select your project from the project navigator to open the project editor. Select your project from the left side of the project editor. Deselect the Use Base Internationalization checkbox.

有两种方法可以消除警告。首先,您可以将部署目标设置为 10.8。其次,您可以关闭基础国际化。从项目导航器中选择您的项目以打开项目编辑器。从项目编辑器的左侧选择您的项目。取消选择使用基本国际化复选框。

enter image description here

在此处输入图片说明

回答by Lorne K

For those who find that turning off base localization deletes the .xib in a new project, another option is to select MainMenu.xib, choose the ‘File Inspector' on the right (looks like a 'new file' icon). Go down to Localization and uncheck Base.

对于那些发现关闭基础本地化会删除新项目中的 .xib 的人,另一个选项是选择 MainMenu.xib,选择右侧的“文件检查器”(看起来像一个“新文件”图标)。转到 Localization 并取消选中 Base。

回答by Borzh

There is another way:

还有一种方法:

  • Remove references from all files in Base.lproj from the project
  • Move files from Base.lproj to ..
  • Add those files again in the project.
  • 从项目中删除 Base.lproj 中所有文件的引用
  • 将文件从 Base.lproj 移动到 ..
  • 在项目中再次添加这些文件。