objective-c - "Flatten compiled xib files"项目构建选项 "do"是什么

标签 objective-c interface-builder xib

"Compiles a XIB file into flattened (non-wrapper) NIB file. After flattening, the resulting NIB is more compact but no longer editable by Interface Builder. When this option is disabled, the resulting NIB file remains editable in Interface Builder."

这是选项的描述,似乎是我能找到的唯一官方引用。事实上,我也找不到太多非官方的信息——我唯一一次看到人们谈论这个设置是关于本地化的难度。

我不知道“扁平化(非包装)”是什么意思。如果任何人都可以阐明这一点,那将减轻我的负担。

虽然我想知道这对我的代码的确切影响,但这里的短期目标是试图弄清楚这是否“弥补”了容器 View 。其唯一目的是在界面构建器中移动分组数据的 View 。执行这些 View ,在对其应用这种“扁平化”之后,仍然会导致设备加载运行时的延迟。一个下午的仪器时间就在我面前,但我过去做过这样的测试,结果好坏参半。

感谢您的任何见解。

最佳答案

在构建过程中,默认情况下,界面构建器文件会被压缩/展平。这样做的好处主要是减小了最终尺寸,或许加载速度也稍微快一些。

在 iOS 3.2 之前,XIB 文件总是被扁平化。仅在 3.2 之后才将此作为选项公开,可能是为了适应某些开发人员的工作流程。

来自 iOS 3.2 发行说明:

To support external localization tools and workflows, Interface Builder 3.2.2 supports an option to save iPhone documents in an editable nib format. Additionally, the Xcode build settings "Flatten Compiled XIB Files" and "Strip NIB Files" now apply to iPhone Interface Builder documents in the same way they apply to Mac OS X documents. By default, nib files will be stripped when built.

iOS 3.2 supports loading unstripped nib files, but iOS releases prior to 3.2 do not. If you choose to build unstripped nib files to support a localization workflow, you should either use ibtool's --strip command to strip nib files after localizing, or temporarily revert the "Flatten Compiled XIB Files" and "Strip NIB Files" build settings to build nib files compatible with previous iOS releases.

关于objective-c - "Flatten compiled xib files"项目构建选项 "do"是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5782868/

相关文章:

objective-c - UICollectionView 在滚动时响应?

macos - 如何在界面生成器中为 UILabel 编写分数?

macos - 使用组合标题栏 + 工具栏,同时保持标题可见性

iphone - XIB 文件无法在 Interface Builder 中正确加载

ios - 在 ScrollView 中循环重置(swift 3)

iphone - 将 .xib 与 Storyboard 一起使用时出现问题

ios - 在 NSTimer 中调用 AFNetworking 导致严重的内存泄漏

javascript - 如何在 JavaScript 中获取 UIWebViews id?

objective-c - 在 IB 中,如何将现有组件放置在新的 SplitView 中?

iphone - 如何通过 KVO 通知传输数据?