Interface Builder (IB) is an application used to design and test the user interface (GUI) on Mac OS X platform. It can intuitively design the graphic interface. In fact, all user interface elements in Mac OS x can be directly generated using code. However, IB allows developers to quickly and easily develop a GUI that complies with Mac OS X Human-Interface Guidelines. Generally, you only need to drag (drag-n-drop) to build the GUI. IB uses nib files to store GUI resources and is applicable to both cocoa and carbon programs. When necessary, the NIB file can be quickly loaded into the memory.
(1) nib2objc
The interface builder file is converted to the objective-C code, which is provided by Adrian kosmaczeski. My helloworldviewcontroller. XIB (right-click and choose run with nib2objc) to run nib2objc. The result is as follows:
Compared with the handwritten version, the manual version is much simpler, but not perfect. Generally, XIB is directly converted into source code files only when the program efficiency is taken into account. However
The connection between the instance variables and the behavior methods set by builder is also gone, and you need to hand over the code. However, this conversion utility exposes all underlying properties.
Https://github.com/akosma/nib2objc/downloads.
(2)Ibtool
Ibtool is a tool for localized nib resource files:
1. Extract strings that can be localized from the NIB file. You can use the following command to process it in the terminal:
Ibtool -- generate-stringsfile mynib. Strings mynib. Nib
2. After the string has been translated, you need to use ibtool to merge the string into the. NIB file. The specific command is as follows:
Ibtool -- strings-file mynib. strings -- write mynewnib. Nib mynib. Nib
Mynib. NiB is the XIB file you want to modify.