Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

iJustinCabral

macrumors member
Original poster
Jul 8, 2012
58
0
Heres my prepare for segue code

Code:
    if ([segue.identifier isEqualToString:@"ListToTaskSegue"])
    {
    
        ToDoList *selectedToDoList = [self.listArray objectAtIndex:self.tableView.indexPathForSelectedRow.row];
        
        ONETaskViewController *taskListVC = segue.destinationViewController;
        taskListVC.title = selectedToDoList.title;
        taskListVC.toDoList = selectedToDoList;
        
        NSLog(@"To-Do List %@",selectedToDoList);
        
    }


Similar code worked like like this for me in another part of my same app, but for some reason, no matter what cell I click, the toDoList that is passed is always the index path of the first cell in the tableView.

Anyone have any ideas what could be happening?


*****************************************************************************
Problem Fixed
*****************************************************************************


Totally forgot that the segue I had set up in storyboard wasn't coming from the cell but a view from something old that I had done. Lesson learned to always double check.
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.