每个标签中的UITableView [英] UITableView in each tab
问题描述
我目前正在开发一个基于标签栏的应用程序,其中包含5个标签,每个标签都有一个UITableView.每个选项卡都链接到普通的UIViewController,前两个选项卡使用xCode默认创建的选项卡,其他选项卡使用我创建的选项卡.如果我尝试将表格视图添加到前两个视图控制器(默认控制器)中,那么一切都会顺利进行,但是当我对其他视图控制器执行相同操作时,应用程序崩溃告诉我:
I'm currently developing a tab bar based application with 5 tabs that have an UITableView each. Each tab is linked to a normal UIViewController, the first two with the ones that xCode creates by default and the others with the ones I created. If I try to add a table view to the first two view controllers (default ones) everything works smoothly, but when I do the same with the others, the app crashes telling me that:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIViewController tableView:numberOfRowsInSection:]: unrecognized selector sent to instance 0x4e2f6f0'
和我的.m文件中的tableView:numberOfRowsInSection:是这样的:
and the tableView:numberOfRowsInSection: in my .m file is this:
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return 2;
}
你现在有什么解决办法吗?我环顾四周没有结果
do you now any solution ? I've looked around with no result
提前感谢答案
推荐答案
请观看本教程. http://www.youtube.com/watch?v=LBnPfAtswgw
这篇关于每个标签中的UITableView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!