CocoaDev

Edit AllPages

Part of the iPhone General/UIKit framework. Subclass of General/UIScroller.

See also: General/UIPreferencesTable and General/UISectionList.

Methods

- (id)initWithFrame:(General/CGRect)frame;

- (void)addTableColumn:(General/UITableColumn*)column;

- (void)setDataSource:(id)dataSource;

- (void)setDelegate:(id)delegate;

- (void)setSeparatorStyle:(int)style

General/SeparatorStyles are: 1 for a 1px grey line, 2 for a 2px grey line, 3 (default) for no separator lines.

- (void)reloadData;

you can deselect the select row by calling the following at the end of the tableRowSelected callback:

<code>General/[notification object]cellAtRow:[[notification object]selectedRow]column:0] setSelected:FALSE withFade:TRUE];</code>

[[EcumeDesJours

Unlike in General/AppKit, you must call reloadData for the table rows to appear.


** Data source methods **

- (int)numberOfRowsInTable:(General/UITable*)table;

- (General/UITableCell*)table:(General/UITable*)table cellForRow:(int)row column:(General/UITableColumn *)column;

- (General/UITableCell*)table:(General/UITable*)table cellForRow:(int)row column:(General/UITableColumn *)column reusing:(BOOL)flag;


** Delegate methods **

- (BOOL)table:(General/UITable *)table showDisclosureForRow:(int)row

Returns YES if a row shows the disclosure arrow, NO if not.

- (BOOL)table:(General/UITable *)table disclosureClickableForRow:(int)row

If YES, table row will be selected if user clicks on disclosure arrow. If NO, selection won’t change (“dead spot” on arrow). If not implemented, defaults to YES.

- (BOOL)table:(General/UITable*)table canSelectRow:(int)row;

Return value indicates whether the row can be selected. Defaults to YES.

- (void)tableRowSelected:(General/NSNotification*)notification;

A General/UITableSelectionNotification notification. The notification’s object is the General/UITable. Called when a row is clicked, even if it was already selected.

- (void)tableSelectionDidChange:(General/NSNotification*)notification;

A General/UITableSelectionDidChangeNotification notification. The notification’s object is the General/UITable.


** Misc. delegate methods **

*scrollerDidScroll: *scroller:adjustSmoothScrollEnd:velocity: *scroller:shouldAdjustSmoothScrollEndForVelocity: *table:willSwipeToDeleteRow: *tableWillLoadVisibleCells: *table:heightForRow: *table:setObjectValue:forTableColumn:row: *table:willDisplayRowsInRange: *table:canDeleteRow: *table:confirmDeleteRow: *table:canInsertAtRow:


(moved General/UISectionList sample code to a new General/UISectionList page..)