我的程序崩溃与下面的报告。UITableView崩溃无法识别的选择器发送到实例
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIView tableView:numberOfRowsInSection:]: unrecognized selector sent to instance 0x7fb4e1c099b0'
这里是我对tableview方法的实现。
崩溃日志here。
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
if (section == 0) {
return 6;
}
return 5;
}
任何人都可以知道为什么会发生这种情况吗?
否则,如果如果????和部分只有一个,为什么你需要检查部分是否为0? –
你的'tableview'总是返回1 for'numberOfRowsInSection' –
请分享完整的崩溃日志。 – Adeel