iphone - Delete Rows from UITableView -
After
Here is the code to delete me, it works fine, but if you open another tab and after that Click on this tab again for the item should be removed because it is not a normal UITableView, you can not just delete from the array and then update the table. So can someone please help me refresh sequence also does not work the piece:
// reload scene completely if ([self isViewLoaded]) {self .view = nil; [Self viewDidload]; } Here's my removal code:
- (void) tableView: (UITableView *) tableView commitEditingStyle: (UITableViewCellEditingStyle) editingStyle forRowAtIndexPath: (NSIndexPath * ) Index Path {// If the row has been removed, remove it from the list. If (editingStyle == UITableViewCellEditingStyleDelete) {// Remove songs from the list & amp; Remove the disc \\ // from the arrays [auto. Remove the Explode ObjectIndex: [IndexPage Line]]; [Self. Remove book object folded: [indexpath line]]; [Self. Remove book image Object Outdx: [IndexPage line]]; NSString * TempWriter = [AutoArtistNamesAre componentJointedBestString: @ ","]; NSString * TempBook = [self.SongNamesArray componentsJoinedByString: @ ","]; NSString * TempBookImageId = [self.YoutubeIDSArray componentszondedbusiness string: @ ","]; TempWriter = [TempWriter substringToIndex: [TempArtistNames length] - 1]; TempBook = [TempBook sub-ruleindex: [TempSongNames length] - 1]; TempBookImageId = [TempBookImageId substringToIndex: [TempYouTube Length] - 1]; // Save details [[NSUserDefaults standardUserDefaults] setValue: [NSString stringWithFormat: @ "% @,", TempBook] forKey: @ "BookName"]; [[Nsusserdefolts Standrdusserdefolts] Setvlua [Nsstring Stringvitformt: @ "% @", Tempvriter] Forky: @ "Writername"]; [[Nsusserdefolts Standrdusserdefolts] Setvlua [Nsstring Stringvitformt: @ "% @", Tempbukimjid] Forky: @ "Imjid"]; [[NSUserDefaults Standard User Defaults] Synchronize]; }} And I ViewWillAppear code:
- (minus) viewWillAppear: (bool) animated {// reload scene completely if ( [Self IsViewLoaded]) {self.view = zero; [Self viewDidload]; }} all that will help
Thanks to 't you have been excluded from the reloadData method appearing to be called at any point. As such, add ...
[reload tableView data]; ... to your - (zero) tableView: (UITableView *) tableView commitEditingStyle: (UITableViewCellEditingStyle) editingStyle forRowAtIndexPath: (NSIndexPath *) indexPath The method should solve the problem.
Comments
Post a Comment