链接数据源时 uitablleview 崩溃
我正在调用一个包含表视图的视图,并正确显示,直到我将数据源链接到文件的所有者并生成以下 SIGABRT 错误。 我不明白发生了什么,因为我在其他视图和作品中设置了表视图!问题与此线程相同,因为我也在使用 ASIHttprequest:
2011-10-13 00:53:36.633 Nimbo[1713:207] -[testViewController tableView:numberOfRowsInSection:]: unrecognized selector sent to instance 0x5c6fa30
2011-10-13 00:53:36.639 Nimbo[1713:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[testViewController tableView:numberOfRowsInSection:]: unrecognized selector sent to instance 0x5c6fa30'
*** Call stack at first throw:
I am calling a view that contains a tableview and is showed properly until I link datsource to file's owner and generates following SIGABRT error.
I do not understand what is happening because I had set tableview in other views and works! Problem is same as this thread because I am also using ASIHttprequest:
2011-10-13 00:53:36.633 Nimbo[1713:207] -[testViewController tableView:numberOfRowsInSection:]: unrecognized selector sent to instance 0x5c6fa30
2011-10-13 00:53:36.639 Nimbo[1713:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[testViewController tableView:numberOfRowsInSection:]: unrecognized selector sent to instance 0x5c6fa30'
*** Call stack at first throw:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您是否在 viewController 中实现了此方法:
因为您缺少此必需的符合 UITableViewDataSource 协议的委托方法视图控制器调用类上所需的方法,因为您尚未实现它,所以它崩溃了。
当您编译代码时,您可能会收到此警告,表明您尚未遵守此协议
Have you implemented this method in you viewController:
Because you are missing this required Delegate method view controller conformed to UITableViewDataSource protocol calls required method on your class since you havent implemented it it crashed.
When you compiled your code likely you have gotten this as warning that you havent conformed to this protocol
您的
testViewController
没有名为tableView:numberOfRowsInSection:
的方法,但在代码中的某个位置[testViewController tableView:numberOfRowsInSection:]; 正在被调用。请在使用
testViewController
的位置发布代码。UITableView 类参考:
Your
testViewController
doesnt have a method calledtableView:numberOfRowsInSection:
but somewhere in your code[testViewController tableView:numberOfRowsInSection:];
is being called. Please post the code where you are usingtestViewController
.UITableView Class Reference: