• 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: Martin Batholdy <email@hidden>
  • Date: Mon, 07 Mar 2011 21:26:30 +0100

Hi,

thanks for the reply.

Is it also possible to filter the entries of an NSDictionary like in SQL?

for example I have a key "type" and different entries.

Is it possible to get an Array of all elements where "type" is equal to "website" (or something like that)?



On 07.03.2011, at 21:05, Wim Lewis wrote:

> 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

_______________________________________________

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: Wim Lewis <email@hidden>
    • Re: easy way to store table-like data
      • From: Dave DeLong <email@hidden>
References: 
 >easy way to store table-like data (From: Martin Batholdy <email@hidden>)
 >Re: easy way to store table-like data (From: Wim Lewis <email@hidden>)

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