更新Xcode9后,我程序所有添加左滑删除的列表 左滑都失效 不走代理方法了
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
return YES;
}
- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath
{
return UITableViewCellEditingStyleDelete;
}
//返回删除按钮的标题
- (nullable NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath
{
return (@"删除";
}
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
if (editingStyle == UITableViewCellEditingStyleDelete)
{
。
}
}
这是我实现左滑删除的方法,之前并没有问题,Xcode9更新后,运行了几次程序才发现程序里面左滑删除全部都失效 不管怎样不走commitEditingStyle这个代理方法,试了好多方法也没解决!都快把我搞崩溃了 代码没有错 就是找不到哪里冲突了
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
return YES;
}
- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath
{
return UITableViewCellEditingStyleDelete;
}
//返回删除按钮的标题
- (nullable NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath
{
return (@"删除";
}
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
if (editingStyle == UITableViewCellEditingStyleDelete)
{
。
}
}
这是我实现左滑删除的方法,之前并没有问题,Xcode9更新后,运行了几次程序才发现程序里面左滑删除全部都失效 不管怎样不走commitEditingStyle这个代理方法,试了好多方法也没解决!都快把我搞崩溃了 代码没有错 就是找不到哪里冲突了
解决方案 »
- 看到某此代码,方法名前面有一个*星号,代表什么意思呢?
- iphone把sqlite中的数据显示到页面中?
- 请教Veency和OSXvnc所使用的语言及开发环境
- 请问做IOS开发的都是在黑苹果上做的吗
- 怎么从xcode里把项目文件上传到csdn code
- 10 分钟为 App 加入实时通讯功能
- 多行UINavigationBar怎么实现的?
- 两个TableView做同步选中行时,选中行高亮效果延迟的问题
- swift与html5交互(原生标题怎么显示为html5的标题)
- AFNetworking如何将responseObject传递出来?
- 请教下socket和http在客户端网络请求中的区别,请大神求教
- 微信中是否能用通用链接直接唤起第三方app
1.检查有没有设置delegate和相关协议的方法
2.重启xcode或者mac