iOS 8 UITableView edit delete status do not click "Delete", the page suspended animation temporary solution

Source: Internet
Author: User

ios8 uitableview edit delete status ( isediting : yes ) do not click on the" Delete "button to click Other locations, UITableView will be suspended animation, not sliding, click Invalid and userinteractionenabled : yes, isediting : no (picture three---> Picture iv);


Workaround: When iOS8 edit delete status does not click "Delete" button click Other location, the page will enter this tableview:caneditrowatindexpath Method (low version will not enter this method) To determine the last item of the list, tableview.isediting = = NO; TableView make list refresh (Reloaddata) while in edit state (picture three---> Picture one)

-(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.navigat        IonItem.rightBarButtonItem.title = @ "Delete";    [Self.datatableview Setediting:no Animated:yes];        }else{Self.navigationItem.rightBarButtonItem.title = @ "View";    [Self.datatableview Setediting:yes Animated:yes]; } dispatch_async (Dispatch_get_global_queue (dispatch_queue_priority_default, 0), ^{dispatch_async (dispatch_g Et_main_queue (), ^{[Self.datatableview Reloaddata];    }); });} -(BOOL) TableView: (UITableView *) TableView Caneditrowatindexpath: (Nsindexpath *) Indexpath {//iOS8 edit delete status not click "Delete" The button will enter this method, judging the last item of the list, tableview.isediting = = NO; TableView is in the edit state when the list refreshes (Reloaddata) if (indexpath.row+1 = = Self.listarray. Count&&!tableview.isediting && [self.navigationItem.rightBarButtonItem.title isequaltostring:@ view]    "]) {[Self edit:nil]; } return YES;

and a little IOS8. When the page is in the "picture three" state, click Back (back to the previous page) the program will flash. WTF, setting the TableView edit state when you leave the page resolves the problem.

-(void) Viewwilldisappear: (BOOL) animated{    [Super viewwilldisappear:animated];    [Self.datatableview Setediting:no animated:no];}

Operation Status Diagram:


iOS 8 UITableView edit delete status do not click "Delete", the page suspended animation temporary solution

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.