SCSelectionCell

@interface SCSelectionCell : SCLabelCell {
  SCDataStore *selectionItemsStore;
  SCDataFetchOptions *selectionItemsFetchOptions;
  BOOL allowMultipleSelection;
  BOOL allowNoSelection;
  NSUInteger maximumSelections;
  BOOL autoDismissDetailView;
  BOOL hideDetailViewNavigationBar;
  BOOL allowAddingItems;
  BOOL allowDeletingItems;
  BOOL allowMovingItems;
  BOOL allowEditDetailView;
  BOOL displaySelection;
  NSString *delimeter;
  NSMutableSet *selectedItemsIndexes;
  SCTableViewCell *placeholderCell;
  SCTableViewCell *addNewItemCell;
}

This class functions as a cell that provides the end-user with an automatically generated detail view of options to choose from, much like the Ringtone selection cell in the iPhone’s sound settings. The selection items are provided in the form of an array of NSStrings, called the items array. ‘SCSelectionCell’ can be configured to allow multiple selection and to allow no selection at all. the bound property of this cell must be of type NSNumber, NSString, or NSMutableSet. If allowMultipleSelection is TRUE, then only NSString and NSMutableSet property types are allowed.

See

SCSelectionSection.

Creation and Initialization

  • Allocates and returns an initialized SCSelectionCell given cell text, bound object, an NSNumber bound property name, and an array of selection items.

    • - parameter: cellText The text that will appear in the cell’s textLabel.
    • - parameter: object The cell’s bound object (see SCTableViewCell class overview).
    • - parameter: propertyName The cell’s bound property name corresponding to the selected item index. Property must be of an NSNumber type and cannot be a readonly property.
    • - parameter: cellItems An array of the items that the user will choose from. All items must be of an NSString type.

    Declaration

    Objective-C

    + (instancetype)cellWithText:(NSString *)cellText
                      boundObject:(NSObject *)object
        selectedIndexPropertyName:(NSString *)propertyName
                            items:(NSArray *)cellItems;
  • Allocates and returns an initialized SCSelectionCell given cell text, bound object, a bound property name, an array of selection items, and whether to allow multiple selection.

    • - parameter: cellText The text that will appear in the cell’s textLabel.
    • - parameter: object The cell’s bound object (see SCTableViewCell class overview).
    • - parameter: propertyName The cell’s bound property name corresponding to the selected items indexes set. Property must be of an NSMutableSet type and can be a readonly property.
    • - parameter: cellItems An array of the items that the user will choose from. All items must be of an NSString type.
    • - parameter: multipleSelection Determines if multiple selection is allowed.

    Declaration

    Objective-C

    + (instancetype)cellWithText:(NSString *)cellText
                        boundObject:(NSObject *)object
        selectedIndexesPropertyName:(NSString *)propertyName
                              items:(NSArray *)cellItems
             allowMultipleSelection:(BOOL)multipleSelection;
  • Allocates and returns an initialized SCSelectionCell given cell text, bound object, an NSString bound property name, and an array of selection items.

    • - parameter: cellText The text that will appear in the cell’s textLabel.
    • - parameter: object The cell’s bound object (see SCTableViewCell class overview).
    • - parameter: propertyName The cell’s bound property name corresponding to the selected item string. Property must be of an NSString type and cannot be a readonly property.
    • - parameter: cellItems An array of the items that the user will choose from. All items must be of an NSString type.

    Declaration

    Objective-C

    + (instancetype)cellWithText:(NSString *)cellText
                        boundObject:(NSObject *)object
        selectionStringPropertyName:(NSString *)propertyName
                              items:(NSArray *)cellItems;
  • Returns an initialized SCSelectionCell given cell text, bound object, an NSNumber bound property name, and an array of selection items.

    • - parameter: cellText The text that will appear in the cell’s textLabel.
    • - parameter: object The cell’s bound object (see SCTableViewCell class overview).
    • - parameter: propertyName The cell’s bound property name corresponding to the selected item index. Property must be of an NSNumber type and cannot be a readonly property.
    • - parameter: cellItems An array of the items that the user will choose from. All items must be of an NSString type.

    Declaration

    Objective-C

    - (instancetype)initWithText:(NSString *)cellText
                      boundObject:(NSObject *)object
        selectedIndexPropertyName:(NSString *)propertyName
                            items:(NSArray *)cellItems;
  • Returns an initialized SCSelectionCell given cell text, bound object, a bound property name, an array of selection items, and whether to allow multiple selection.

    • - parameter: cellText The text that will appear in the cell’s textLabel.
    • - parameter: object The cell’s bound object (see SCTableViewCell class overview).
    • - parameter: propertyName The cell’s bound property name corresponding to the selected items indexes set. Property must be of an NSMutableSet type and can be a readonly property.
    • - parameter: cellItems An array of the items that the user will choose from. All items must be of an NSString type.
    • - parameter: multipleSelection Determines if multiple selection is allowed.

    Declaration

    Objective-C

    - (instancetype)initWithText:(NSString *)cellText
                        boundObject:(NSObject *)object
        selectedIndexesPropertyName:(NSString *)propertyName
                              items:(NSArray *)cellItems
             allowMultipleSelection:(BOOL)multipleSelection;
  • Returns an initialized SCSelectionCell given cell text, bound object, an NSString bound property name, and an array of selection items.

    • - parameter: cellText The text that will appear in the cell’s textLabel.
    • - parameter: object The cell’s bound object (see SCTableViewCell class overview).
    • - parameter: propertyName The cell’s bound property name corresponding to the selected item string. Property must be of an NSString type and cannot be a readonly property.
    • - parameter: cellItems An array of the items that the user will choose from. All items must be of an NSString type.

    Declaration

    Objective-C

    - (instancetype)initWithText:(NSString *)cellText
                        boundObject:(NSObject *)object
        selectionStringPropertyName:(NSString *)propertyName
                              items:(NSArray *)cellItems;

Configuration

Configuring Special Cells

  • When set to a valid cell object, ‘placeholderCell’ will be displayed when no items exist in the generated section. As soon as any items are added, this cell automatically disappears. Default: nil.

    Declaration

    Objective-C

    @property (nonatomic, strong) SCTableViewCell *placeholderCell;
  • When set to a valid cell object, ‘addNewItemCell’ will be displayed as the last cell of the generated section, and will add a new item to the section whenever it gets tapped by the user. This cell can be used as an alternative to addButtonItem. Default: nil.

    Declaration

    Objective-C

    @property (nonatomic, strong) SCTableViewCell *addNewItemCell;
  • When TRUE, addNewItemCell will be displayed in Normal Mode. Default: FALSE.

    Declaration

    Objective-C

    @property (nonatomic) BOOL addNewItemCellExistsInNormalMode;
  • When TRUE, addNewItemCell will be displayed in Editing Mode. Default: TRUE.

    Declaration

    Objective-C

    @property (nonatomic) BOOL addNewItemCellExistsInEditingMode;