The iOS framework that grows only as fast as its documentation
NISegmentedControlFormElement Class Reference

Overview

A segmented control form element.

This element presents a segmented control. You can initialize it with a label for the cell, an array of NSString or UIImage objects acting as segments for the segmented control and a selectedIndex. The selectedIndex can be -1 if you don't want to preselect a segment.

A delegate method (didChangeSelector) will be called on the didChangeTarget once a different segment is selected. The segmented control will be passed as an argument to this method.

Inheritance diagram for NISegmentedControlFormElement:
NIFormElement <NICellObject>

Tasks

(id) + segmentedControlElementWithID:labelText:segments:selectedIndex:didChangeTarget:didChangeSelector:
 
(id) + segmentedControlElementWithID:labelText:segments:selectedIndex:
 
(Class) - cellClass
 
(UITableViewCellStyle) - cellStyle
 

Method Documentation

segmentedControlElementWithID:labelText:segments:selectedIndex:didChangeTarget:didChangeSelector:

Initializes a segmented control form cell with callback method for value change events.

+ (id)segmentedControlElementWithID:(NSInteger)elementID labelText:(NSString *)labelText segments:(NSArray *)segments selectedIndex:(NSInteger)selectedIndex didChangeTarget:(id)target didChangeSelector:(SEL)selector;
Discussion
Parameters
elementIDAn ID for this element.
labelTextText to show on the left side of the form cell.
segmentsAn array containing NSString or UIImage objects that will be used as segments of the control. The order in the array is used as order of the segments.
selectedIndexIndex of the selected segment. -1 if no segment is selected.
targetReceiver for didChangeSelector calls.
selectorMethod that is called when a segment is selected.

segmentedControlElementWithID:labelText:segments:selectedIndex:

Initializes a segmented control form cell.

+ (id)segmentedControlElementWithID:(NSInteger)elementID labelText:(NSString *)labelText segments:(NSArray *)segments selectedIndex:(NSInteger)selectedIndex;
Discussion
Parameters
elementIDAn ID for this element.
labelTextText to show on the left side of the form cell.
segmentsAn array containing NSString or UIImage objects that will be used as segments of the control. The order in the array is used as order of the segments.
selectedIndexIndex of the selected segment. -1 if no segment is selected.

cellClass

The class of cell to be created when this object is passed to the cell factory.

- (Class)cellClass;
Discussion

cellStyle

The style of UITableViewCell to be used when initializing the cell for the first time.

- (UITableViewCellStyle)cellStyle;
Discussion