Tracking changes to NSTableView datasource
Tracking changes to NSTableView datasource
- Subject: Tracking changes to NSTableView datasource
- From: Andre Masse <email@hidden>
- Date: Fri, 31 Oct 2008 18:37:10 -0400
Hi,
I have a datasource for an NSTableView which is a NSMutableArray (call
it mainArray for the moment) and I'm not sure which way is better to
manage add, update and delete rows. I can use either one array for
each of those cases or add a field to the mainArray (like 1 for new, 2
for update) and only one array for the records to delete (I'm using a
back-end database). The first problem with the former is if (when) the
user add a row and modify it later on (but before any updates to the
back-end are done) I will need to check if its a new row (by quering
the newRows array) and then not add it to the update array if it is.
Not counting keeping both array content in sync... With the later,
only checking the field will tell me if its a new row or not. At this
point, I prefer the second method and can't see too many problems with
it... Now, how you guys handle these kind of things?
Any ideas, suggestions?
Thanks,
Andre Masse
_______________________________________________
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