SCObjectSection

@interface SCObjectSection : SCTableViewSection {
  SCPropertyGroup *propertyGroup;
}

This class functions as an SCTableViewModel section that is able to automatically generate its cells from a given bound object’s properties. If the bound object is given without an extended class definition (SCClassDefinition), then cells will only be generated for properties of type NSString and NSNumber, and will be either of type SCTextFieldCell or SCNumericTextFieldCell, respectively. If an SCClassDefinition is provided for the bound object, a full fledged section of cells will be generated.

@note: For your convenience, the tag property of each generated cell will have a number corresponding to the index of it’s corresponding property in bound object.

See

SCArrayOfObjectsSection, SCObjectCell.

Creation and Initialization

  • Allocates and returns an initialized ‘SCObjectSection’ given a header title and a bound object. *

    • - parameter: sectionHeaderTitle A header title for the section.
    • - parameter: object The object that ‘SCObjectSection’ will use to generate its cells.

    Declaration

    Objective-C

    + (instancetype)sectionWithHeaderTitle:(NSString *)sectionHeaderTitle
                               boundObject:(NSObject *)object;
  • Allocates and returns an initialized ‘SCObjectSection’ given a header title, a bound object and its extended class definition. *

    • - parameter: sectionHeaderTitle A header title for the section.
    • - parameter: object The object that ‘SCObjectSection’ will use to generate its cells.
    • - parameter: definition The definition for the object.

    Declaration

    Objective-C

    + (instancetype)sectionWithHeaderTitle:(NSString *)sectionHeaderTitle
                               boundObject:(NSObject *)object
                     boundObjectDefinition:(SCDataDefinition *)definition;
  • Allocates and returns an initialized ‘SCObjectSection’ given a header title, a bound object and its extended class definition along with a property group. *

    • - parameter: sectionHeaderTitle A header title for the section.
    • - parameter: object The object that ‘SCObjectSection’ will use to generate its cells.
    • - parameter: definition The definition for the object.
    • - parameter: group Limits the generated properties to the ones in the property group only.

    Declaration

    Objective-C

    + (instancetype)sectionWithHeaderTitle:(NSString *)sectionHeaderTitle
                               boundObject:(NSObject *)object
                     boundObjectDefinition:(SCDataDefinition *)definition
                             propertyGroup:(SCPropertyGroup *)group;
  • Allocates and returns an initialized ‘SCObjectSection’ given a header title, a bound object and its data store along with a property group. *

    • - parameter: sectionHeaderTitle A header title for the section.
    • - parameter: object The object that ‘SCObjectSection’ will use to generate its cells.
    • - parameter: store The data store for the bound object.
    • - parameter: group Limits the generated properties to the ones in the property group only.

    Declaration

    Objective-C

    + (instancetype)sectionWithHeaderTitle:(NSString *)sectionHeaderTitle
                               boundObject:(NSObject *)object
                          boundObjectStore:(SCDataStore *)store
                             propertyGroup:(SCPropertyGroup *)group;
  • Returns an initialized ‘SCObjectSection’ given a header title and a bound object. *

    • - parameter: sectionHeaderTitle A header title for the section.
    • - parameter: object The object that ‘SCObjectSection’ will use to generate its cells.

    Declaration

    Objective-C

    - (instancetype)initWithHeaderTitle:(NSString *)sectionHeaderTitle
                            boundObject:(NSObject *)object;
  • Returns an initialized ‘SCObjectSection’ given a header title, a bound object and its extended class definition. *

    • - parameter: sectionHeaderTitle A header title for the section.
    • - parameter: object The object that ‘SCObjectSection’ will use to generate its cells.
    • - parameter: definition The definition for the object.

    Declaration

    Objective-C

    - (instancetype)initWithHeaderTitle:(NSString *)sectionHeaderTitle
                            boundObject:(NSObject *)object
                  boundObjectDefinition:(SCDataDefinition *)definition;
  • Returns an initialized ‘SCObjectSection’ given a header title, a bound object and its extended class definition along with a property group. *

    • - parameter: sectionHeaderTitle A header title for the section.
    • - parameter: object The object that ‘SCObjectSection’ will use to generate its cells.
    • - parameter: definition The definition for the object.
    • - parameter: group Limits the generated properties to the ones in the property group only.

    Declaration

    Objective-C

    - (instancetype)initWithHeaderTitle:(NSString *)sectionHeaderTitle
                            boundObject:(NSObject *)object
                  boundObjectDefinition:(SCDataDefinition *)definition
                          propertyGroup:(SCPropertyGroup *)group;
  • Returns an initialized ‘SCObjectSection’ given a header title, a bound object and its data store along with a property group. *

    • - parameter: sectionHeaderTitle A header title for the section.
    • - parameter: object The object that ‘SCObjectSection’ will use to generate its cells.
    • - parameter: store The boundObject data store.
    • - parameter: group Limits the generated properties to the ones in the property group only.

    Declaration

    Objective-C

    - (instancetype)initWithHeaderTitle:(NSString *)sectionHeaderTitle
                            boundObject:(NSObject *)object
                       boundObjectStore:(SCDataStore *)store
                          propertyGroup:(SCPropertyGroup *)group;

Cell Management

  • Returns the cell associated with the given bound object’s property name.

    • - parameter: propertyName The bound object’s property name.
    • - returns: Returns nil if no cell have been generated for the given property name, or if the property name does not exist within the bound object.

    Declaration

    Objective-C

    - (SCTableViewCell *)cellForPropertyName:(NSString *)propertyName;

Other

Internal Methods (should only be used by the framework or when subclassing)