Long time Wood has written a blog, the table view of the previous study of other content are written, today from the deletion of the line to start, I hope that they can persist. Come on, (^ω^). Say less nonsense,,, directly on the code:
The following is the core code for deleting a row:
-(void) TableView: ( UITableView *) TableView Commiteditingstyle: (uitableviewcelleditingstyle) Editingstyle Forrowatindexpath :(nsindexpath *) indexpath{
if (Editingstyle = =uitableviewcelleditingstyledelete) {
[aremoveobjectatindex: Indexpath. Row ];
[TVdeleterowsatindexpaths: [ nsarray Arraywithobject: Indexpath] withrowanimation: Uitableviewrowanimationautomatic];
}
}
Of course to implement the delete line before the function, to achieve compliance with the delegate protocol:
@interface Viewcontroller: Uiviewcontroller < Uitableviewdatasource , uitableviewdelegate >{
iboutletuitableview *tv;
nsmutablearray *a;
nsarray *b;
}
iOS Development Learning # Table View # (1) Delete Row