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


The base class for form element cells.

Doesn't do anything particularly interesting other than retaining the element.

Inheritance diagram for NIFormElementCell:
<NICell> NIDatePickerFormElementCell NISegmentedControlFormElementCell NISliderFormElementCell NISwitchFormElementCell NITextInputFormElementCell


(BOOL) - shouldUpdateCellWithObject:
(BOOL) + shouldAppendObjectClassToReuseIdentifier
(CGFloat) + heightForObject:atIndexPath:tableView:

Method Documentation


Called when a cell is created and reused.

- (BOOL)shouldUpdateCellWithObject:(id)object;

Implement this method to customize the cell's properties for display using the given object.


Asks the receiver whether the mapped object class should be appended to the reuse identifier in order to create a unique cell.object identifier key.

+ (BOOL)shouldAppendObjectClassToReuseIdentifier;

This is useful when you have a cell that is intended to be used by a variety of different objects.


Asks the receiver to calculate its height.

+ (CGFloat)heightForObject:(id)object atIndexPath:(NSIndexPath *)indexPath tableView:(UITableView *)tableView;

The following is an appropiate implementation in your tableView's delegate:

-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
CGFloat height = tableView.rowHeight;
id object = [(NITableViewModel *)tableView.dataSource objectAtIndexPath:indexPath];
id class = [object cellClass];
if ([class respondsToSelector:@selector(heightForObject:atIndexPath:tableView:)]) {
height = [class heightForObject:object atIndexPath:indexPath tableView:tableView];
return height;

You may also use the tableView:heightForRowAtIndexPath:model: methods on NICellFactory to achieve the same result. Using the above example allows you to customize the logic according to your specific needs.