Editing Style of UITableView - Add/Delete
I added the following code in my UITableViewController subclass, it shows something like in the screen shot, which is like a radio button, can select/deselect it. Selected button does have red-colored tick symbol. What is the button meant for?
- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath {
return UITableViewCellEditingStyleDelete | UITabl开发者_JAVA百科eViewCellEditingStyleInsert;
}
The function you have used is for selecting value/values from the list in the table view. But before you use this function you have to include two more functions in your viewController :
- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath
- (BOOL)tableView:(UITableView *)tableView shouldIndentWhileEditingRowAtIndexPath:(NSIndexPath *)indexPath
You can use the selected value of the list somewhere else, may be in the next viewController.
精彩评论