Must I call -reloadRowsAtIndexPaths:withRowAnimation: inside an -beginUptades -endUpdates block?
Must I call -reloadRowsAtIndexPaths:withRowAnimation: inside an -beginUptades -endUpdates block?
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.
It depends what you are trying to do.
You should use beginUpdates/endUpdates for “subsequent insertions, deletion, and selection operations (for example, cellForRowAtIndexPath: and indexPathsForVisibleRows) to be animated simultaneously” (from UITableView beginUpdates)
However, if all you need to do is update the value of something in a cell you don’t need the -reloadRowsAtIndexPaths call to be inside a beginUpdates/endUpdates.
You can actually just grab the cell directly and update the value in a lot of cases.
See UITableView -reloadRowsAtIndexPaths for more specifics