views:

460

answers:

2

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

NSArray *paths = [aUITableView indexPathsForVisibleRows];

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];

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.

+1  A: 

That does sound like a bug. If you really are worried about the warning, you might be able to get rid of it by simply doing [cells release] on the line proceeding its declaration.

Matt Bridges
+2  A: 

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

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

Instead of:

NSArray *cells = [aUITableView visibleCells];

write:

[aUITableView visibleCells];
porneL