• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: easy way to store table-like data
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: easy way to store table-like data
      • From: Martin Batholdy <email@hidden>
References: 
 >easy way to store table-like data (From: Martin Batholdy <email@hidden>)

  • Prev by Date: easy way to store table-like data
  • Next by Date: NSMapTable options
  • Previous by thread: easy way to store table-like data
  • Next by thread: Re: easy way to store table-like data
  • Index(es):
    • Date
    • Thread