IOS development and learning # Table view # (1) delete a row
I have been writing a blog for a long time. I have written all the other contents in the table view I learned earlier. Today, let's start with deleting a row and hope you can stick to it .. Come on (^ ω ^ ).. Let's talk a little bit about it., directly add the Code:
The core code for deleting a row is as follows:
-(Void) tableView :( UITableView *) tableView commitEditingStyle :( UITableViewCellEditingStyle) editingStyle forRowAtIndexPath :( NSIndexPath *) indexPath {if (editingStyle = inline) {[aremoveObjectAtIndex: indexPath. row]; [tvdeleteRowsAtIndexPaths: [NSArrayarrayWithObject: indexPath] withRowAnimation: UITableViewRowAnimationAutomatic];}
To delete a row, follow the delegate protocol:
@ Interface ViewController: UIViewController
{IBOutletUITableView * TV; NSMutableArray * a; NSArray * B ;}