I am trying to show a UIAlertView before deleting a cell from a UITableView
NSIndexPath *_tmpIndexPath; - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { if(editingStyle == UITableViewCellEditingStyleDelete) { _tmpIndexPath = indexPath; NSLog(@"%d", indexPath.row);
So, both of my logs are returning the correct path.
I have my view passing UIAlertView
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex { NSLog(@"%d", _tmpIndexPath.row); if(buttonIndex == 1) { NSLog(@"%d", _tmpIndexPath.row); } }
Now I canβt understand why in clickButtonAtIndex() I get an error when trying to register _tmpIndexPath.row
*** -[NSIndexPath row]: message sent to deallocated instance 0x12228e00
source share