如何修复“在 Xcode 4.2 之前无法使用自由格式大小模拟指标”警告?

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

How can I fix "Freeform Size simulated metrics are not available prior to Xcode 4.2" warnings?

iosxcodeipadxcode4warnings

提问by Dirty Henry

Since a couple of weeks, I've been using XCode 4.2 with projects created with previous XCode 3.x versions.

几个星期以来,我一直在使用 XCode 4.2 和以前的 XCode 3.x 版本创建的项目。

When creating some custom iPad views, I often use the "freeform" attribute of Interface Builder to be able to have views with an arbitrary size.

在创建一些自定义 iPad 视图时,我经常使用 Interface Builder 的“freeform”属性来拥有任意大小的视图。

But then, I get build the following build warnings: "warning: Attribute Unavailable: Freeform Size simulated metrics are not available prior to Xcode 4.2."

但是,我得到了以下构建警告:“警告:属性不可用:在 Xcode 4.2 之前,自由格式大小模拟指标不可用。”

My question is: how can I fix these warnings?

我的问题是:如何修复这些警告?

ps: First, I assumed it meant my project wouldn't be backward-compatible with earlier versions of XCode (which doesn't bother me at all) and tried to tell Xcode so, by setting the Project Format to XCode 4.2-compatible only. Unfortunately, the dropdown menu for the project format only suggests "XCode 3.2-compatible" and "XCode 3.1-compatible".

ps:首先,我认为这意味着我的项目不会与早期版本的 XCode 向后兼容(这根本不打扰我)并试图通过将项目格式设置为 XCode 4.2-compatible 来告诉 Xcode . 不幸的是,项目格式的下拉菜单只建议“XCode 3.2-compatible”和“XCode 3.1-compatible”。

回答by kyleobrien

Open the .xib file in question and show the Utilities pane. Click on the File Inspector tab and under Interface Builder Document you'll see a Development field. Change it to Xcode 4.2.

打开有问题的 .xib 文件并显示“实用工具”窗格。单击 File Inspector 选项卡,在 Interface Builder Document 下,您将看到 Development 字段。将其更改为 Xcode 4.2。

Xcode / IB Screenshot

Xcode / IB 截图