0
votes

As the title says none of my tableview controller methods are being called.

The steps I went through to create my table view are as follows.

1) I created a new file based on UITableViewController and selected the create with xib option. I Named my file myStuffViewController.

2) I have a rootview controller which is a UIViewController. In this view I have a navigation controller that I want to push my tableview controller onto at a certain point.

3) I setup my tableview and nav controller like so

mystuff = [[MyStuffViewController alloc]initWithNibName:@"MyStuffViewController"bundle:[NSBundle mainBundle]];
    accountView = [[AccountView alloc] initWithNibName:@"Login" bundle:[NSBundle mainBundle]];




    accountViewNavController = [[UINavigationController alloc] init];
     accountViewNavController.delegate = self;


    NSArray *ar= [NSArray arrayWithObjects:accountView,mystuff, nil];
    [accountViewNavController setViewControllers:ar animated:NO];
    [accountViewNavController popToRootViewControllerAnimated:NO];
    accountView.title=@"Login";

4) Then when a user pushes a button I want to push the table view controller onto the stack like this.

[accountViewNavController pushViewController:mystuff animated:YES];

I've even tried calling [self.tableView reloadData] but none of the methods get called.

Could somebody propose why my table view methods are not being called?

EDIT 1

Just so I'm being as clear as I can be here is what my header file looks like. To be it doesnt seems like I'm missing anything.

@interface MyStuffViewController : UITableViewController<UITableViewDataSource,UITableViewDelegate> {
    RemixView *remixView;
    NSMutableArray *remixListArray;
    TBXML*tbxml;


}
@property(nonatomic,retain)NSMutableArray *remixListArray;
@property(nonatomic,retain)RemixView *remixView;
@property(nonatomic ,retain)TBXML *tbxml;

-(void)fetchRemixList:(NSString *)uid key:(NSString *)k1;
- (void)configureCell:(UITableViewCell *)cell atIndexPath:(NSIndexPath *)indexPath;
@end
1
please check whether you have connected or coded for tableview delegate and data sourceNarayanan Ramamoorthy
hmmmm, I'm sorry but I don't completely follow. I have coded for tableview delegate, the delegate methods were generated by xcode. From what I can see the view was automatically connected to the controller by xcode also. Is that what you meant?dubbeat
I second you Narayanan. Just make sure that delegate has been set.Nitish
okay if you're totally satisfied that the delegate is pointing in the correct place then the next thing to check is the delegate method's signature - i.e.is it exactly as it should be? The easiest way to be absolutely sure the signature is correct is to copy it from the documentation.Damo

1 Answers

0
votes

Check

  1. You declare in the .h file that you implement the two table view delegates UITableViewDelegate & UITableViewDatasource

  2. In the NIB make sure you link to your delegate in file owner OR if you have created the TableView programmatically make sure you set the delegate ivar also.

Then see if the delegate methods start getting called