Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Tracking changes to NSTableView datasource



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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.