views:

45

answers:

0

Hi! I have a Navigation-based Aplication where I have many view controllers each one with a tableview. The access to the view controllers depends on which row the user selects. Now i'm having a problem which is: when i select a row in the first viewcontroller i go to the second view controller but the tableview in the second view controller isn't loading. The method cellForRowAtIndexPath is never called. I get the tableview but with nothing in the rows. The tableview delegate and datasource is set to the files owner in the xib.

I will put some code to understand what i'm saying.

In the first view controller i call the second this way:

   1. - (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath  
   2. {  
   3.     (...)  
   4.   
   5.     if (self.tasksController == nil) {  
   6.         TasksViewController *taskCont = [[TasksViewController alloc] initWithNibName:@"TasksViewController" bundle:nil];  
   7.         self.tasksController = taskCont;  
   8.         [taskCont release];  
   9.     }  
  10.       
  11.     [self.navigationController pushViewController:tasksController animated:YES]; // "Pushing the controller on the screen"   
  12. }  

Thanks for your help! :)