PDA

View Full Version : Bad Access error in table view issue




luckylefty01
Jul 25, 2008, 01:34 AM
Could anybody point me in the right direction as far as figuring out where this error is coming from?

Program received signal: “EXC_BAD_ACCESS”.
(gdb) bt
#0 0x300c87ec in objc_msgSend ()
#1 0x30aa1378 in -[UITableView(_UITableViewPrivate) _updateAnimationDidStop:finished:context:] ()
#2 0x30a7b804 in -[UIViewAnimationState sendDelegateAnimationDidStop:finished:] ()
#3 0x30a7b96c in -[UIViewAnimationState animationDidStop:finished:] ()
#4 0x31e935bc in run_animation_callbacks ()
#5 0x31e933b4 in CATransactionTimerCallback ()
#6 0x3025bff2 in CFRunLoopRunSpecific ()
#7 0x3025b58a in CFRunLoopRunInMode ()
#8 0x316998ec in GSEventRunModal ()
#9 0x30a5e310 in -[UIApplication _run] ()
#10 0x30a671e4 in UIApplicationMain ()
#11 0x000020bc in main (argc=1, argv=0x2ffff5c8) at .../main.m:14

It shows up on a semi-regular basis when I'm deleting rows from my table.

This is the code I'm using to actually do the deleting:

- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
NSLog(@"DeleteCellAtRow: %i", indexPath.row);

// Retain record so it doesn't get lost when array releases it
Record *recordToMove = [[records objectAtIndex:indexPath.row] retain];

if (editingStyle == UITableViewCellEditingStyleDelete) {
[records removeObjectAtIndex:indexPath.row];
}
[recordTable deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:YES];
[webservice moveRecordWithName:recordToMove.username];
[recordToMove release];
}

Thanks for any help...I'm stumped!



ayasin
Jul 25, 2008, 11:30 PM
well that error usually means something is being over released. I can't tell from your snippit what that might be right off but one thing I did notice is that you delete always but only remove from the array on the delete action. Try running instruments and seeing if you can find any objects being over released.

cruisercoder
May 11, 2009, 03:18 PM
Hey LuckyLefty01, did you find out what this issue was? I'm having a similar issue.