Inherits from SCArrayOfObjectsSection : SCArrayOfItemsSection : SCTableViewSection : NSObject
Declared in SCTableViewSection.h

Overview

This class functions as a section that provides the end-user with an automatically generated list objects to choose from.

The selection items are provided in the form of an array of NSObjects, called the items array. ‘SCObjectSelectionSection’ can be configured to allow multiple selection and to allow no selection at all. If allow multiple selection is disabled, then the bound property name of this section must be of type NSObject, otherwise it must be of type NSMutableSet.

Properties

allowMultipleSelection

If TRUE, the section allows multiple selection. Default: FALSE.

@property (nonatomic, readwrite) BOOL allowMultipleSelection

Declared In

SCTableViewSection.h

allowNoSelection

If TRUE, the section allows no selection at all. Default: FALSE.

@property (nonatomic, readwrite) BOOL allowNoSelection

Declared In

SCTableViewSection.h

autoDismissViewController

If TRUE, the section automatically dismisses the current view controller when a value is selected. Default: FALSE.

@property (nonatomic, readwrite) BOOL autoDismissViewController

Declared In

SCTableViewSection.h

deselectedCellTextColor

The text color of the deselected cell(s).

@property (nonatomic, strong) UIColor *deselectedCellTextColor

Declared In

SCTableViewSection.h

intermediateEntityDefinition

Set this to the definition of the intermediate entity between the bound object’s class definition and the itemsEntityClassDefinition. This is useful in complex many-to-many relationships where you have created an intermediate entity between you main two entities. Default: nil.

@property (nonatomic, strong) SCDataDefinition *intermediateEntityDefinition

Declared In

SCTableViewSection.h

maximumSelections

The maximum number of items that can be selected. Set to zero to allow an infinite number of selections. Default: 0.

@property (nonatomic, readwrite) NSUInteger maximumSelections

Discussion

Note: Only applicable when allowMultipleSelection is TRUE.

Declared In

SCTableViewSection.h

selectedCellTextColor

The text color of the selected cell(s).

@property (nonatomic, strong) UIColor *selectedCellTextColor

Declared In

SCTableViewSection.h

selectedItemIndex

This property reflects the current section’s selection. You can set this property to define the section’s selection.

@property (nonatomic, copy) NSNumber *selectedItemIndex

Discussion

Note: In case of no selection, this property will be set to an NSNumber of value -1.

Declared In

SCTableViewSection.h

selectedItemsIndexes

This property reflects the current section’s selection(s). You can add index(es) to the set to define the section’s selection.

@property (nonatomic, readonly) NSMutableSet *selectedItemsIndexes

Declared In

SCTableViewSection.h

Class Methods

sectionWithHeaderTitle:boundObject:selectedObjectPropertyName:items:itemsDefintion:

Allocates and returns an initialized ‘SCObjectSelectionSection’ given cell text, bound object, a bound property name, and an array of selection items.

+ (instancetype)sectionWithHeaderTitle:(NSString *)sectionHeaderTitle boundObject:(NSObject *)object selectedObjectPropertyName:(NSString *)propertyName items:(NSArray *)sectionItems itemsDefintion:(SCDataDefinition *)definition

Parameters

sectionHeaderTitle

The section’s header title.

object

The object the section will bind to.

propertyName

The section’s bound property name corresponding to the object selection. If multiple selection is allowed, then property must be of an NSMutableSet type, otherwise, property must be of type NSObject and cannot be a readonly property.

sectionItems

An array of the items that the user will choose from. All items must be of an NSObject type and all items must be instances of the same class.

definition

The definition of the selection items.

Declared In

SCTableViewSection.h

sectionWithHeaderTitle:boundObject:selectedObjectPropertyName:selectionItemsStore:

Allocates and returns an initialized ‘SCObjectSelectionSection’ given cell text, bound object, a bound property name, and a selection items store.

+ (instancetype)sectionWithHeaderTitle:(NSString *)sectionHeaderTitle boundObject:(NSObject *)object selectedObjectPropertyName:(NSString *)propertyName selectionItemsStore:(SCDataStore *)store

Parameters

sectionHeaderTitle

The section’s header title.

object

The object the section will bind to.

propertyName

The section’s bound property name corresponding to the object selection. If multiple selection is allowed, then property must be of an NSMutableSet type, otherwise, property must be of type NSObject and cannot be a readonly property.

store

The store containing the selection objects.

Declared In

SCTableViewSection.h

Instance Methods

initWithHeaderTitle:boundObject:selectedObjectPropertyName:items:itemsDefintion:

Returns an initialized ‘SCObjectSelectionSection’ given cell text, bound object, a bound property name, and an array of selection items.

- (instancetype)initWithHeaderTitle:(NSString *)sectionHeaderTitle boundObject:(NSObject *)object selectedObjectPropertyName:(NSString *)propertyName items:(NSArray *)sectionItems itemsDefintion:(SCDataDefinition *)definition

Parameters

sectionHeaderTitle

The section’s header title.

object

The object the section will bind to.

propertyName

The section’s bound property name corresponding to the object selection. If multiple selection is allowed, then property must be of an NSMutableSet type, otherwise, property must be of type NSObject and cannot be a readonly property.

sectionItems

An array of the items that the user will choose from. All items must be of an NSObject type and all items must be instances of the same class.

definition

The definition of the selection items.

Declared In

SCTableViewSection.h

initWithHeaderTitle:boundObject:selectedObjectPropertyName:selectionItemsStore:

Returns an initialized ‘SCObjectSelectionSection’ given cell text, bound object, a bound property name, and a selection items store.

- (instancetype)initWithHeaderTitle:(NSString *)sectionHeaderTitle boundObject:(NSObject *)object selectedObjectPropertyName:(NSString *)propertyName selectionItemsStore:(SCDataStore *)store

Parameters

sectionHeaderTitle

The section’s header title.

object

The object the section will bind to.

propertyName

The section’s bound property name corresponding to the object selection. If multiple selection is allowed, then property must be of an NSMutableSet type, otherwise, property must be of type NSObject and cannot be a readonly property.

store

The store containing the selection objects.

Declared In

SCTableViewSection.h