开发者

UITabBar with TableView using Nib

I am developing one application which contains one TabBar. OnTouch of a tab bar item I am loading a different nib. This nib contains a 开发者_如何学JAVAnavigation bar + tableview. I am connecting the datasource and delegates of the table to the File's Owner and getting the following error.

UITabBar with TableView using Nib

When I am disconnecting the dataSource with the file's owner then it is responding but the Table Functions are not working.

Any suggestions how can I make the TableView functions working ?

EDIT :

My .h file :

UITabBar with TableView using Nib

.m file :

UITabBar with TableView using Nib

Xib Connections

UITabBar with TableView using Nib

Still the same error. :(


Your data source does not implement the tableView:numberOfRowsInSection:, that's the reason of the error.

If you have doubts about it, please post the data source implementation, so we can help further.

EDIT: a few more checks...

  1. How are you loading the nib file? initWithNibName or loadNibNamed?

  2. Is the controller view outlet connected to your view? (I guess so, but just asking)

  3. Are you doing anything special in your controller's initWithNibName, loadView, or viewDidLoad?

If in doubt, add more code from those methods (text is fine)


If you are using your UIViewController as delegate and data source for its table, it has to implements the methods from the UITableViewDataSource and UITableViewDelegate protocols.

The method tableView:numberOfRowsInSection: is one of those strictly required in the class that implements the UITableViewDataSource protocol, so you probably want to fix this implementation.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜