Core Data, bindings & to-many relationship
Core Data, bindings & to-many relationship
- Subject: Core Data, bindings & to-many relationship
- From: Paul Gribble <email@hidden>
- Date: Tue, 13 Dec 2005 22:51:23 +0000 (GMT)
- Priority: normal
I am writing a little toy app using Core Data to keep track of my expenses
when I travel. I have a "Trip" entity with attributes like dateStart,
dateEnd, location, purpose, etc. I have the interface for this working, of
course it's not that difficult.
What I want to do next is have a list of "transactions" for each trip that
keep track of money spent. Each transaction would have a date, amount, and
purpose.
I have tried creating a "Transaction" entity in the data model, and
connecting the "Trip" entity to it using a to-many relationship, and the
inverse connection back to "Trip" using a to-one relationship.
The problem I am running into now is that in my GUI I can see a list of ALL
transactions for all trips, but how do I make my NSListView only display
transactions for the currently selected Trip?
I have read all of the Apple tutorials on core data and bindings and I am
still at a loss.
Thanks for any suggestions,
PS I also thought of doing the following: write a custom "Trip" class that
has as one of its instance variables an NSArray that would then contain my
"transactions" for the particular trip. This would sidestep core data
however and I thought, there must be a way to do this using core data.
_______________________________________________
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