• 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: core data approach to multi-column data?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: core data approach to multi-column data?


  • Subject: Re: core data approach to multi-column data?
  • From: Jesse Grosjean <email@hidden>
  • Date: Tue, 22 Aug 2006 16:50:17 -0400

I am trying to think about how (a) to design the core data entities,
and (b) how to link them easily to a view (e.g. NSTableView). One
idea is to have an entity called "row" which has a many-to-one
relationship to an entity called "column". Then each row of data can
have multiple columns. The question then is how to get an NSTableView
to be bound to display each "column" of data in its own column in the
NSTableView. Core data seems set up for more traditional database-
style apps where a row in an NSTableView is a single entity, and the
different columns are different attributes of that entity.

Any thoughts? The reason I'm thinking core data is pure laziness, the
file opening/saving, searching, and undo/redo comes basically for free

See this thread for info on designing the core data entities.

	http://www.cocoabuilder.com/archive/message/cocoa/2006/1/3/153637

In my experience this sort of thing is difficult to model so that it's efficient and easy to query. For my application I tried a number of different approaches, but none were really satisfactory. In the end the only approach that was fast enough was to hardcode the columns as attributes in the row entity. That means that columns can't change dynamically, but I deal with this by modifying the managed object model, and then migrate the data to that new model... a big pain, and a bit of a hack, but it work for my application where columns need to change, but not very often.

Jesse

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: NSSQLiteStoreType and remove
  • Next by Date: Re: NSWorkspace launchApplication fails on some apps
  • Previous by thread: Re: core data approach to multi-column data?
  • Next by thread: Polling battery data, missing cycle count
  • Index(es):
    • Date
    • Thread