objective-c .NIB -> .XIB 怎么了?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1068191/
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
What's up with the .NIB -> .XIB?
提问by Devoted
What's up with the NIB->XIB change somewhere between XCode 3.0 to 3.1? Is there any difference with this name change that I should know while I go through tutorials that mention nothing but the .nib file?
NIB->XIB 在 XCode 3.0 到 3.1 之间的某个地方发生了什么变化?在我浏览仅提及 .nib 文件的教程时,我应该知道这个名称更改有什么区别吗?
回答by kent
XIB's are very cool. they are basically an un-compiled NIB (in XML format if memory serves me)
XIB 非常酷。它们基本上是一个未编译的 NIB(如果没记错的话,采用 XML 格式)
during the build process they are converted to NIB's to be deployed in the final product.
在构建过程中,它们被转换为 NIB 以部署在最终产品中。
回答by Tom Dalling
As I understand it, xib files are xml nibfiles. xib files are compiled into nibs when the application is built. The xib format was created because nib files don't mesh well with version control (because they're not text), whereas a plain text xml file works well.
据我了解,xib 文件是xml n ib文件。构建应用程序时,xib 文件被编译为 nib。创建 xib 格式是因为 nib 文件与版本控制不匹配(因为它们不是文本),而纯文本 xml 文件运行良好。
回答by Quinn Taylor
The other answers and link explain whatXIB files are, but not about the specific change.
其他答案和链接解释了XIB 文件是什么,但没有说明具体的变化。
The new flat-file .xibformat was introduced with Leopard (and Xcode 3.0) in 2007, but I believe that .nibremained the default, primarily for compatibility with older versions of Xcode and OS X. With Xcode 3.1, there was a shift to .xibas the preferred format. However, most documentation hasn't been updated, probably in part because the distinction is fairly minor from the standpoint of a normal developer.
2007 年 Leopard(和 Xcode 3.0)引入了新的平面文件.xib格式,但我相信.nib仍然是默认格式,主要是为了与旧版本的 Xcode 和 OS X 兼容。使用 Xcode 3.1,有一个转变到的.xib作为优选格式。但是,大多数文档尚未更新,部分原因可能是因为从普通开发人员的角度来看,区别很小。
I definitely echo the sentiment that XIB files are much better than NIB files, especially when using version control. (Flat files are much easier to manage than directory packages in most tools.)
我绝对赞同 XIB 文件比 NIB 文件好得多的观点,尤其是在使用版本控制时。(在大多数工具中,平面文件比目录包更容易管理。)
回答by Lucasware
the XIBfile (XML Interface Builder) was introduced into Xcode because NIBfiles (Nxt Interface Builder) weren't so user/editable friendly. XIB's are designed in the format of a raw XML document making it a human-readable source code. Although the older bundled NIB files where editable, they were still a tiny bit more complicated than just a simple XIB, They contained multiple files including the XML XIB. Now most NIBs are compiled and are not readable by anything except for your Mac so it can read them. Apple started using compiled NIB files because people could read and understand the code put into other peoples programs :o. Xcode uses the "ibtool" command to compile nibs now. If you wish to know more about compiled Nibs go to my detailed answer at this post
的XIB文件(XML我覆盖整个院落乙uilder)引入的Xcode因为NIB文件(ÑXT我覆盖整个院落乙uilder) 不是那么用户/可编辑友好。XIB 以原始 XML 文档的格式设计,使其成为人类可读的源代码。虽然旧的捆绑 NIB 文件可以编辑,但它们仍然比简单的 XIB 复杂一点,它们包含多个文件,包括 XML XIB。现在大多数 NIB 都是编译好的,除了 Mac 之外的任何东西都无法读取,因此它可以读取它们。Apple 开始使用已编译的 NIB 文件,因为人们可以阅读和理解放入其他人程序中的代码:o。Xcode 现在使用“ibtool”命令来编译笔尖。如果您想了解有关编译 Nib 的更多信息,请参阅我在这篇文章中的详细回答

