Re: Calculating row heights for view-based table rows, on re-use throws error
Re: Calculating row heights for view-based table rows, on re-use throws error
- Subject: Re: Calculating row heights for view-based table rows, on re-use throws error
- From: Erik Stainsby <email@hidden>
- Date: Sat, 18 Aug 2012 16:20:53 -0700
Thanks for the thought Fritz. Removing my ham-handed attempt to purge the tableView of its rows indeed resolved the out of range error.
On 2012-08-18, at 8:24 AM, Fritz Anderson <email@hidden> wrote:
>> My expectation is that I ought to be able to clear the table (iterating through the rows and applying -removeRowsAtIndexes:withAnimation: to discard the present rowViews, and start clean with the next record to be displayed, generating new rowViews as needed (because the number of component elements (phone numbers/email addresses/etc) will vary from one record to the next).
>
> Not a good expectation, if you are altering a collection while you are iterating it. (You imply that's what you're doing, but it's not clear.) Doing so leaves the collection in an inconsistent condition, and anything that depends on the collection will have invalid data. (But see next paragraph.) The table view might, for instance, try to index to a row for which the backing data no longer exists.
I am now left with the two simple problems of
a) trying to remove populated but out dated tableRowViews from the tableView, and
b) establishing the correct rowHeight for each subsequent reuse of the tableView.
Any advice on where to start reading appreciated.
~ Erik
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden