Tables showing different kinds of core data entities
Tables showing different kinds of core data entities
- Subject: Tables showing different kinds of core data entities
- From: Matteo Rossi <email@hidden>
- Date: Wed, 26 Apr 2006 14:13:40 +0200
I have a problem with core data & bindings.
Let's suppose I define an abstract entity called Shape with one
attribute called area.
Next I create two derived entities: Rectangle and Circle; the first
has two attributes width and height and the second has one attribute,
radius.
I implement the calculation of area for each entity assigning them to
two different classes CRectangle and CCircle derived from
NSManagedObject.
Next in IB I create two NSArrayController for Rectangle and one for
Circle (rectangleController and circleController) and implement a
table view with add/remove buttons.
All is perfectly working. First problem: if I create a second
NSArrayController for Rectangle (rectangleController2) and I bind a
table view to this new one I can't see Rectangle entities I have
created with the first NSArrayController (rectangleController).
Is it right ? Shouldn't entities of the same kind and in the same
managed context share the same data ?
Here comes the second problem: I want to display all the entities I
create (both rectangles or circles) in a single table with two
columns: one for a counter and a second for areas. I have tried
creating a NSArrayController for Shape (shapeController) and bind it
to my tableview, but it doesn't work: rectangles and circles created
don't appear in this new table. What's the problem ?
Is there any flag to set in the Attributes pane of
NSArrayControllers ? Should I provide any programmatic implementation
to handle this situation ?
Thanks in advance
Matteo Rossi
_______________________________________________
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