What does the "Flatten compiled xib files" project build option "do"
"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."
This is the description of the option, and seems to be the only official reference t开发者_StackOverflow中文版hat I can find. And in fact, I can't find much unofficial either -- the only times I see people talking about this setting is in regards to the difficulty of localization.
I don't know what "flattened (non-wrapper)" means. If anyone can shed some light on this, it'd take a load off my mind.
While I'd like to know the exact effect this has on my code, the short-term goal here is trying to figure out if this 'makes up' for container views. Views whose sole purpose is shifting grouped data around in interface builder. Do those views, after having this 'flattening' applied to it, still cause delays at run time on the device in loading. An afternoon with instruments is ahead of me, but I've had some mixed results doing tests like this in the past.
Thanks for any insight.
Interface builder files are compacted/flattened by default during the build process. The advantage of this is mainly a reduced final size, perhaps slightly faster loading as well.
Before iOS 3.2, XIB files were always flattened. Only after 3.2 was this exposed as an option, probably to fit the workflow of some developers.
From the iOS 3.2 release notes:
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.
精彩评论