关于 didSelectRowAtIndexPath 和 didDeselectRowAtIndexPath 的区别 其实从 字面意思上就能理解
可就是今天因为这个犯错了...
因为开发的时候,以为是重用了 . 然后 根本没有往这个方面去想
一遍遍重复写这个代码 总是出错.. (就是因为习惯了 Xcode的 自动补全... )
现在泪奔了都 ~~o(>_<)o ~~
希望大家注意
选中
- (void)tableView:(UITableView *)tableView didDeselectRowAtIndexPath:(NSIndexPath *)indexPath
取消选中
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
本文介绍了UITableView中didSelectRowAtIndexPath和didDeselectRowAtIndexPath两个方法的区别。在开发过程中,由于误以为是方法重用,导致了错误的发生。didSelectRowAtIndexPath用于选中行的回调,而didDeselectRowAtIndexPath则是取消选中行时触发。提醒开发者要注意这两个方法的正确使用。
1万+

被折叠的 条评论
为什么被折叠?



