Still have to use a lock to protect the data backing a UITableView?
Still have to use a lock to protect the data backing a UITableView?
- Subject: Still have to use a lock to protect the data backing a UITableView?
- From: G S <email@hidden>
- Date: Fri, 15 Apr 2011 13:02:26 -0700
Hi all.
I have a tableview that displays data from a collection of C++ objects. In
the background, I download an updated collection occasionally, then
reconcile it with the one being shown by the tableview.
I coded it so the list reconciliation occurs on the main thread, but is that
enough to protect it from data requests from UITableView (by delaying those
requests until the reconciliation is done)? Obviously if the tableview is
trying to pull data out of the collection when one of the entries is
deleted, it'll crash.
There's also the problem of the user tapping an entry to show details about
the underlying object; the object could get blown away if there's a pending
list update. This I could address by copying the object into the detail
view instead of using a pointer, but I'm wondering if I shouldn't just lock
the underlying object collection.
Any suggestions would be appreciated.
_______________________________________________
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