UITable Row Deletion Woes...

Discussion in 'iOS Programming' started by stephanos180, Dec 16, 2010.

  1. stephanos180 macrumors member

    Joined:
    Aug 23, 2006
    Location:
    Downey, CA
    #1
    Hi, everyone. I'm new to developing and am just trying to figure out how to delete rows. Can someone please help me figure out what's going on? The last line is causing the error... Thanks.

    Code:
     - (void)tableView:(UITableView *)tv commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
    
        if (editingStyle == UITableViewCellEditingStyleDelete) {
    		Timer_ProAppDelegate *appDelegate = (Timer_ProAppDelegate*)[[UIApplication sharedApplication] delegate];
    		[appDelegate.playlists removeObjectAtIndex:indexPath.row];
    		[self.tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
    	}
    	
    }
    
    
    Here's the console output.

    2010-12-16 16:50:13.596 Timer Pro[44881:207] *** -[NSIndexPath count]: unrecognized selector sent to instance 0x39268c0
    2010-12-16 16:50:13.598 Timer Pro[44881:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSIndexPath count]: unrecognized selector sent to instance 0x39268c0'
     
  2. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #2
    What is self.tableView when the error occurs? Often, "unrecognized selector" indicates an over-released object.
     

Share This Page