First create a table view and set the delegation method and data source for it.
self.contacts=[[UITable alloc]init]; self.contacts.dataSource=self; self.contacts.delegate=self; self.contacts.userInteractionEnabled=YES;
And then override the delegation methods and data sources, override the following methods to delete.
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
For the minus sign on the left, use self.contacts.editing = YES; In my case, I do not want this minus sign to simply not use this property or set self.contacts.editing = NO;
Thanks, hw731 , to remind me of this property, I spent half a day on it.
source share