arachide
arachide

Reputation: 8066

get the invisible UITableViewCell

I used the code below to get an invisible UITableViewCell

NSIndexPath* path = [NSIndexPath indexPathForRow:row inSection:0];
UITableViewCell *cell = [listTableview cellForRowAtIndexPath:path];

path returns something, but cell returns nil.

It looks like the code above only can get the visible UITableViewCell.

Your comment welcome

Upvotes: 0

Views: 149

Answers (1)

Rakesha Shastri
Rakesha Shastri

Reputation: 11242

The docs clearly say it needs to be visible.

An object representing a cell of the table, or nil if the cell is not visible or indexPath is out of range.

Also, you are initializing the index just like how you would intialize any other variable, which has nothing to do with it having to be a valid indexPath.

Upvotes: 1

Related Questions