UITableViewDataSource

From iPhone Development Wiki
Revision as of 19:54, 11 December 2009 by KennyTM~ (talk | contribs) (Created page with ''''UITableViewDataSource''' is a protocol that interfaces between a UITableView and its data model. == Text fields in cells == {{function signature |signature=-(void)tableVi…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

UITableViewDataSource is a protocol that interfaces between a UITableView and its data model.

Text fields in cells

Signature -(void)tableView:(UITableView*)tableView didUpdateTextFieldForRowAtIndexPath:(NSIndexPath*)indexPath withValue:(NSString*)value;
Available in 3.0 –

If a UITableViewCell has an associated text field, the data source may implement this method to catch updates to it by the user.

Copy and paste

Signature -(void)tableView:(UITableView*)tableView performAction:(SEL)action forRowAtIndexPath:(NSIndexPath*)indexPath withSender:(id)sender;
-(BOOL)tableView:(UITableView*)tableView canPerformAction:(SEL)action forRowAtIndexPath:(NSIndexPath*)indexPath withSender:(id)sender;
-(BOOL)tableView:(UITableView*)tableView shouldShowMenuForRowAtIndexPath:(NSIndexPath*)indexPath;
Available in 3.1 –

Starting from 3.1, table view cells may invoke the UIMenuController by long-pressing the cell without 3rd-party extensions. The data source must implement the above 3 methods to support it.

References