I have a Table View Controller with cells. I want to update the text that is displayed on the visible UITableViewCells. Is there a way to get a reference to the cells that are currently on the screen?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
What you can do is go and ask for the cells at index paths using
- (UITableViewCell *)cellForRowAtIndexPath:(NSIndexPath *)indexPath, if they are not nil, you know they are on the screen and you can do what you wish with them. Also if you know the visible rectangle on the screen (which shouldnt be hard to get) you can use tableViews- (NSArray *)indexPathsForRowsInRect:(CGRect)rectand you can get all your visible index paths and usecellForRowin order to get the cells back.As long as this is marked as answer, I stand corrected, like others said you can do
[tableView visibleCells]