ios - if delete first section - app crash -


If I delete the last cell in my sections, then I have to delete the section

to start - This work is right, but if I delete my first section - app crash

and delete my last sections - Add button

What happens?

My code

  - (minus) deleteExerciseFromCustomTable: (NSIndexPath *) indexPath {[[_exercises objectAtIndex: indexPath.section] removeObjectAtIndex: indexPath .row]; [_previewTable start update]; [_Remove Removal Delete RAATI and XEpath: @ [IndexPath] with RA-Animation: UITTViewerAnonymous Right]; [_previewTable End and Update]; If ([[object Otandaksaksaksaks: Indekspethksekshn] count] == ​​0) {[_group removeObjectAtIndex: indexPath.section]; [_previewTable start update]; [_praviawtable Deletesekshns [Nsindeksset Indekssetvithindeks: Indekspatksekshn] Vithrovnimsn: Uitblaviawrovnimsnrigt]; [_previewTable End and Update]; }} - (NSInteger) tableView: (UITableView *) tableView numberOfRowsInSection: (NSInteger) section {if (section == [separate group count]) {return 1; } And {return [[_exercises ObjectAntxX: section] count]; }} - (NSInteger) numberOfSectionsInTableView: (UITableView *) table view {return [_group count] + 1; }      

zero) deleteExerciseFromCustomTable: (NSIndexPath *) indexPath {if ([[_exercises objectAtIndex: indexPath.section] count] == ​​1) {[removeObjectAtIndex separate groups: indexPath.section]; [_ Excursive object atindex: indexpath.section]; [_previewTable start update]; [_Remove Removal Delete RAATI and XEpath: @ [IndexPath] with RA-Animation: UITTViewerAnonymous Right]; [_praviawtable Deletesekshns [Nsindeksset Indekssetvithindeks: Indekspatksekshn] Vithrovnimsn: Uitblaviawrovnimsnrigt]; [_previewTable End and Update]; } And {{[Object Performance Execution: IndexPath. Section] Object to remove: indexpath.ro]; [_previewTable start update]; [_Remove Removal Delete RAATI and XEpath: @ [IndexPath] with RA-Animation: UITTViewerAnonymous Right]; [_previewTable End and Update]; }}

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -