ios - TableView :performAction:forRowAtIndexPath:withSender delegates show warning

标签 ios uitableview ios7

在我的代表中它显示警告

- (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

您可能混淆了返回 voidtableView:performAction:forRowAtIndexPath:withSender: 方法与 tableView:canPerformAction:forRowAtIndexPath:withSender: code> 方法,它返回 BOOL

关于ios - TableView :performAction:forRowAtIndexPath:withSender delegates show warning,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20963794/

相关文章:

iphone - 在 cellForRowInIndexPath 中创建数组

iphone - 配置 UItableView 不在 iPhone 上滚动

iphone - 容器覆盖 UITableView - iOS 7 中的 SearchBar/SearchDisplayController

ios7 - 在 iOS 7 上访问用户的电话号码

ios - 嵌套枚举可以保存在 UserDefaults 中吗?

objective-c - 多行自动调整大小文本UILabel

ios - UITableView 重新加载行在 iOS 11.2 中不自然地抽动 TableView

ios - XMPPFramework - 如何更改我的个人资料状态?

iphone - NSMutableArray 索引删除

ios - public private 和 protected in objective-c