Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3607970
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T21:26:36+00:00 2026-05-18T21:26:36+00:00

in app i have custom tableview(UITableView *tableView) which subclass of uiviewcontroller & in tableview

  • 0

in app i have custom tableview(UITableView *tableView) which subclass of uiviewcontroller & in tableview editing is show perfectly but when i delete row

- (void)tableView:(UITableView *)tableView1 commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {

    if (editingStyle == UITableViewCellEditingStyleDelete) {
        // Delete the row from the data source
        //[appDelegate deleteItemAtIndexPath:indexPath];
        [self testing:indexPath];
        [tableView deleteRowsAtIndexPaths:
         [NSArray arrayWithObject:indexPath] 
                     withRowAnimation:UITableViewRowAnimationFade];//in this line app crash 
        NSLog(@"delete row");
        [tableView reloadData];
    }   
    else if (editingStyle == UITableViewCellEditingStyleInsert) {
        // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
        //nothing to do item already added
    }   
} 

in this method when breakpoint goes at that line

[tableView deleteRowsAtIndexPaths: [NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];

my application crash what i do for come out from it.

-(void)testing:(NSIndexPath *)path{

Player *doc = [[Player alloc]init];
NSMutableArray* reversedArray = [[NSMutableArray alloc] initWithArray:[[[[NSArray alloc] initWithArray: _data] reverseObjectEnumerator] allObjects]];

doc = [reversedArray objectAtIndex:path.row];
NSLog(@"%@,%d", doc.name,path.row);
[self deleteRow:doc];

}

-(void)deleteRow:(Player *)doc{

// ReferMeAppDelegate *appDelegate = (ReferMeAppDelegate *) [[UIApplication sharedApplication]delegate];
self.party = [PartyParser loadParty];
if (_party != nil) {
for (Player *player in _party.players) {
NSLog(@”%@, %@”, player.name,player.alert);
NSComparisonResult resultName, resultEmail, resultPhone, resultLocation;
//NSString *str = [appDelegate.plistDict valueForKey:@”flag”];
//if ([player.email length] != 0 && player.alert == @”1″){
resultName = [doc.name compare:player.name];
resultEmail = [doc.email compare:player.email];
resultPhone = [doc.phone compare:player.phone];
resultLocation = [doc.location compare:player.location];
if(resultName == 0 && resultEmail == 0 && resultPhone == 0 && resultLocation == 0){
//lblName1.text = @”equal”;
Player *playerr = [[Player alloc]init];
playerr = player;
[_party.players removeObject:playerr];
//[_party.players removeObjectAtIndex:path.row];
break;
}
// }
//if([player.email length] == 0 && player.alert == @”2″){
else{
resultName = [doc.name compare:player.name];
resultPhone = [doc.phone compare:player.phone];
if (resultName == 0 && resultPhone == 0) {
Player *playerr = [[Player alloc]init];
playerr = player;
[_party.players removeObject:playerr];
break;
}
}
}

        for (Player *player in _party.players) {
            NSLog(@"after match case player names");
            NSLog(@"%@", player.name);
        }
        [PartyParser saveParty:_party];
    }

}

I’m using GData xml in app which support read & write operations.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T21:26:37+00:00Added an answer on May 18, 2026 at 9:26 pm

    deleteRowsAtIndexPaths: method only performs visual effect of deletion, you must also manually delete corresponding item from your data source so number of items in it will be consistent with what is expected from your operation, e.g.:

    //You need to remove item from data source
    [yourMutableDataArray removeObjectAtIndex:indexPath.row]; 
    // Tell table view to remove the corresponding item cell
    [tableView deleteRowsAtIndexPaths:
                 [NSArray arrayWithObject:indexPath] 
                 withRowAnimation:UITableViewRowAnimationFade];//in this line app crash 
    NSLog(@"delete row");
    //[tableView reloadData]; // You do not need this line
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.