[UITableView indexPathsForVisibleRows]可能出现的错误? [英] possible bug with [UITableView indexPathsForVisibleRows]?

查看:495
本文介绍了[UITableView indexPathsForVisibleRows]可能出现的错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在我的代码中尝试此操作,但这不起作用:

I been trying this in my code and it doesn´t work:

NSArray *paths = [aUITableView indexPathsForVisibleRows];

返回一个空的NSArray. 但是,如果我在上一行中执行此操作,则工作正常....这是框架错误吗?

An empty NSArray is returned. But if I do this in the previous line it works fine....is this a framework bug?

NSArray *cells = [aUITableView visibleCells];
NSArray *paths = [aUITableView indexPathsForVisibleRows];

问题是我真的不需要cell数组.因此,我收到未使用变量的警告....我不喜欢代码中的警告. jeje.

The thing is I don`t really need the cells array. So I´m getting a warning for the unused variable....and I don´t like warnings in my code. jeje.

推荐答案

它看起来像个错误–您可能要

It looks like a bug – you may want to report it.

如果未使用的变量有问题,请不要创建未使用的变量! :)

If unused variable is a problem, then don't create unused variable! :)

代替:

NSArray *cells = [aUITableView visibleCells];

写:

[aUITableView visibleCells]; // don't remove, workaround for a bug <link here>

这篇关于[UITableView indexPathsForVisibleRows]可能出现的错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆