Fine-Grain Control
A drawer accessible from the "Classes" tab provides fine-grain control in the rapid prototype source code. Open it with the "<" button; close it by dragging or with the ">" button.
The check boxes control features of the rapid prototype code. Each check box results in one or more lines of code generated. By default, each check box is checked -- by default, all the lines of code appear. If you find you want less, you can delete it later.
Selected Class
- Declare KVC keys
For each of the properties of the class, provides a string with a symbolic name as a key, declared in the *.h file, and assigned in the *.m file. The symbolic names for the keys are then used for keyed archiving, and possibly in the class method for the KVC keys. If this box is unchecked, the others below it are also unchecked.
- Class method for KVC keys
Apple's documentation suggests that the developer make note of the keys used by each class in Key-Value Coding. Suite Modeler goes further, and generates a class method that returns them in an array. The method proves useful for the argument of the takeValuesForKeys: method. (Before keyed archiving appeared, it was even handier for XML archiving.)
- Implement Keyed Archiving
This feature is the primary use of the symbolic names for the KVC keys:
Selected Property
- Implement accessors
One of the advantages of Key-Value Coding is that accessor methods are not strictly necessary. However, we often have work to do in the accessors, especially in the set methods. Often, when a "Model" object changes, we need to inform a "Controller" so it can update a "View" (didChange). Also, in Cocoa, the set method also sends a message to the Undo Manager. See the Sketch example.
- setter calls undoManager
See below.
- setter calls didChange
See below.
- declaration -- Object or Primitive
Typically, each property of a class must be declared as an object. For attributes of approprite type (NSNumber, NSNumber, NSData) two radio buttons permit the user to choose between using the primitive and object-oriented forms. In the examples above, 'myAttribute' was declared as a primitive; 'myOtherAttribute' was declared as an object.