TAILIEUCHUNG - Lập trình Wrox Professional Xcode 3 cho Mac OS part 37

giữ cho các lớp bạn định nghĩa trong công cụ thiết kế giao diện đồng bộ với mã nguồn của ứng dụng. Nếu không, bạn kết thúc với một tài liệu ngòi có chứa các lớp học, cửa hàng, và hành động mà không thực sự tồn tại trong ứng dụng. Các hóa thân hiện đại của giao diện Builder loại bỏ những vấn đề này bằng cách loại bỏ một lần đi, chỉnh sửa. | 278 CHAPTER 13 INTERFACE BUILDER keep the classes you define in the interface design tool in synchronization with the source code of the application. If that fails you end up with a nib document that contains classes outlets and actions that don t actually exist in the application. The modern incarnation of Interface Builder eliminates these problems by eliminating round-trip editing. You define your classes outlets and actions in the Xcode project and then switch to Interface Builder to create configure and connect them together. It s demonstrably the fastest and easiest way to work and it keeps your project in perfect synchronization with your nib document. Nevertheless a few vestiges of the old methodology still lurk in Interface Builder. The commands File Read Class Files and File Write Class Files will import or export class definitions from to a text file. To export a class choose one or more objects in a nib document and choose File Write Class Files. Interface Builder will generate skeleton class definitions that include every outlet and action method Interface Builder is aware of. It does not include any attribute properties. To import a class choose File Read Class Files and select one or more class definition .h files. Interface Builder will interpret these locating all of the iBOutlet and iBAction declarations and add the class to its internal model of known classes. You can now create custom instances of the class that will include the defined outlets and actions. It s up to you to ensure that those classes with those outlets and actions exist at run time. NIB DOCUMENT FORMATS Both Xcode and Cocoa have evolved over the years. The format of nib documents has changed to accommodate that evolution adding new features and capabilities along with compatibility issues. The biggest recent change in Interface Builder has been the support for a new XML-based nib document. The XML document is compiled to produce the binary NIB file that s actually deployed with

Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.