ios - TableView setEditing also enables row deletion -


I want to rearrange the rows in my tableview I have already implemented these two methods.

  - (zero) table view: (UITableView *) table view invoice row: endpath: (NSIndexPath *) from InexexPath toIndexPath: (NSIndexPath *) toIndexPath {NSLog (@ "Move Row in Index"); } - (BOOL) Table view: (UITableView *) Table view canMoveRowAtIndexPath: (NSIndexPath *) Index pathway {nslog (@ "path index can go on path"); If (indexPath.section == 0 || (indexPath.section == 1and indexPath.row == 0)) {NSLog (@ "do not"); no return; } Yes return; }   

Now I want to reorder cells only and do not want the users to remove cells and do not want the user to remove the cells. But when I edit [tableView setEditing: yes animated: yes]; , it also enables the user to remove items from the table view, I want to show the re-arranged control in the table view, such as on an iPhone Settings- & gt;

thanks

Try to implement this way

  - (BOOL) table view: (UITableView *) Table view can edit the Route Width: (NSIndexPath *) indexPath {return Yes; } // Method to remove method "-" from edit mode Mark - (UITableViewCellEditingStyle) Table view: (UITableView *) table view editing system ForRowAtIndexPath: (NSIndexPath *) indexPath {return UITableViewCellEditingStyleNone; } - (BOOL) TableView: (UITableView *) Tableview should should be: Device Editing Route & Peth: (NSINXAP *) IndexPath {No Refund; } - (BOOL) Table view: (UITableView *) Table view canMoveRowAtIndexPath: (NSIndexPath *) Index pathway {return yes; } - (Zero) Table view: (UITableView *) Table view HilaryTypePath: (NSIndexPath *) sourceIndexPath toIndexPath: (NSIndexPath *) DestinationWindexPath {// Update your data here and work accordingly ...... & gt; }    

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -