在我的代表中它显示警告
- (BOOL)tableView:(UITableView *)tableView performAction:(SEL)action forRowAtIndexPath:(NSIndexPath *)indexPath withSender:(id)sender
{
return YES;
}
警告:'tableView:performAction:forRowAtIndexPath:withSender:' 的实现中的返回类型冲突:'void' 与 'BOOL'(又名。'signed char')
指导我解决这个警告
最佳答案
根据协议(protocol)的要求,将返回类型设置为void
:
- (void)tableView:(UITableView *)tableView performAction:(SEL)action forRowAtIndexPath:(NSIndexPath *)indexPath withSender:(id)sender
您可能混淆了返回 void
的 tableView:performAction:forRowAtIndexPath:withSender:
方法与 tableView:canPerformAction:forRowAtIndexPath:withSender:
code> 方法,它返回 BOOL
。
关于ios - TableView :performAction:forRowAtIndexPath:withSender delegates show warning,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20963794/