Ios 8 UITableView: do not click "delete" to edit the deletion status. The temporary solution is suspended on the page. iosuitableview
In ios8 UITableView, edit the deletion status (isEditing: YES). If you do not click the delete button and click another location, the UITableView is suspended and cannot be moved. If you click "invalid", userInteractionEnabled: YES, isEditing: NO (picture 3 ---> Picture 4 );
In earlier versions (such as ios5), if you do not click "delete", the UITableView will return to the editing status (picture 3 ---> picture 2 ).
Solution: When you do not click "delete" to edit the Deletion Status of ios8 and click another location, the tableView: canEditRowAtIndexPath method is displayed on the page (this method is not available for earlier versions). The last item in the list is determined, tableView. isEditing = NO; reloadData (picture 3 ---> picture 2)
-(Void) viewDidLoad {[super viewDidLoad]; UIBarButtonItem * barBtnItemRight = [[UIBarButtonItem alloc] initWithTitle: @ "delete" style: UIBarButtonItemStyleDone target: self action: @ selector (edit :)]; self. navigationItem. rightBarButtonItem = barBtnItemRight; [barBtnItemRight release];}-(void) edit :( id) sender {if ([self. navigationItem. rightBarButtonItem. title isEqualToString: @ "View"]) {self. navigationItem. rightB ArButtonItem. title = @ "delete"; [self. dataTableView setEditing: NO animated: YES];} else {self. navigationItem. rightBarButtonItem. title = @ "View"; [self. dataTableView setEditing: YES animated: YES] ;}}-(BOOL) tableView :( UITableView *) tableView canEditRowAtIndexPath :( NSIndexPath *) indexPath {// modify the Deletion Status of ios8. If you do not click the "delete" button, this method is displayed. The last item in the list is tableView. isEditing = NO; When tableView is editing, the list is refreshed (reloadData) if (indexPath. row + 1 = self. listArray. count &&! TableView. isEditing & [self. navigationItem. rightBarButtonItem. title isEqualToString: @ "View"]) {[self. dataTableView setEditing: YES animated: NO]; dispatch_async (dispatch_get_global_queue (queue, 0), ^ {dispatch_async (dispatch_get_main_queue (), ^ {[self. dataTableView reloadData];});} return YES ;}
Another point is that when the page is in the "Image 3" status in IOS8, the program will flash back when you click "return to the previous page. WTF: When you leave the page, you can set the edit status of TableView to solve this problem.
- (void)viewWillDisappear:(BOOL)animated{ [super viewWillDisappear:animated]; [self.dataTableView setEditing:NO animated:NO];}
Operation status chart: