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.-
Undocumented
Declaration
Objective-C
SCPropertyGroup *propertyGroup
-
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;
-
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;
-
The section’s bound object’s group of properties that are rendered into cells.
Declaration
Objective-C
@property (nonatomic, strong) SCPropertyGroup *propertyGroup;
-
///////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////
Declaration
Objective-C
- (void)setBoundObject:(NSObject *)boundObject withStore:(SCDataStore *)boundObjectStore autoGenerateCells:(BOOL)autoGenerateCells;
-
Configures the cell for the given property definition.
Declaration
Objective-C
- (void)configureCell:(SCTableViewCell *)cell forPropertyDefinition:(SCPropertyDefinition *)propertyDefinition inEditingMode:(BOOL)editing;
-
Generates cells based on boundObjectClassDefinition and the given editing state.
Declaration
Objective-C
- (void)generateCellsForEditingState:(BOOL)editing;
-
Method called internally by framework to reload cells values, if needed.
Declaration
Objective-C
- (void)reloadCellsIfNeeded;