Re: easy way to store table-like data
Re: easy way to store table-like data
- Subject: Re: easy way to store table-like data
- From: Wim Lewis <email@hidden>
- Date: Mon, 07 Mar 2011 12:05:36 -0800
Well, sqlite3 is available on the system (and is used by a lot of Apple code, so hopefully it won't be removed in the near future); you could simply use that, if that API is what you're most familiar with.
However, unless you have a pretty large data set, sqlite is probably overkill and it'd be easier to use a plist. I would start with an NSArray of NSDictionaries, and then if it makes the code cleaner replace the NSDictionaries with custom objects containing the fields you're interested in and whatever other methods logically belong there.
NSArrayController can do sorting and filtering of these objects for you for presentation in the table view; if NSArrayController doesn't do what you need then it's easy enough to sort and filter them yourself and then implement the NSTableView data source methods. Take a look at the NSArrayController and bindings API documentation--- if bindings do what you need, they're really quick and convenient.
_______________________________________________
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