views:

215

answers:

3

Hi, I am using the same technique as i populate my UITableView in iphone while writing my iPad application. Tab Bar Controller >UINavigationController>UITableViewController of type myCustomTable(load From NIB)

MyCustomTableViewController NIB and class file implements the delegate methods

@interface MyCustomTableViewController : UITableViewController <UITableViewDelegate, UITableViewDataSource> {

 NSMutableArray *PDFList;
 IBOutlet UITableView *PDFTable;

}

but my delegate methods are not getting called. What do i do?

A: 

Did you set the delegate and datasource of the table in IB? If you have, and everything is wired up, it should work.

FWIW - This is my biggest problem with nibs. If you run into problems it's much harder to ask for help from people who aren't local.

DougW
everything is hooked up in the IB....
jAmi
Not trying to be rude, but *something* has to not be connected properly. Assuming you've properly implemented the delegate/datasource methods, and have your property, the problem has to be in the wiring between IB and your code. I have migrated code from iphone to ipad and I can vouch that nothing has changed in this regard.
DougW
ok... Ill try this code on iPhone OS3.1.2 simulator
jAmi
+1  A: 

Make sure you have properly set your 'Class' in Identity Inspector (Tools -> Identity Inspector) in Interface Builder. Also set the appropriate 'Referencing Outlet' in Interface Builder.

Tom S
this is done... anyother thing that i need to worry about....please...the deadline is approaching for this project and i cant get this basic thing to work
jAmi
A: 

Found the solution....

in the tableView delegate method - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView

i was returning 0 and hence none of the delegate methods were being called.

jAmi
jAmi - just a quick FYI... numberOfSectionsInTableView sets sections in the table, and then you have rows within each of those sections (that you set in another call for rows).. so if you had 0 sections, you have no data in the table and it won't anything. You should always return at least 1 for this value.So your problem had nothing to do with your delegate and datasource hookups. They were correct.
iWasRobbed
Yes I did return 1 in that method and it worked
jAmi