So I am working on an application for a friend to keep track of book orders he makes for the store where we work. I am having trouble getting the relationships I set up to work properly.
What I have so far:
Core Data model with two entities, Book and Order
Only simple attributes set up for now, title and date, respectively
A to-many relationship (booksOrdered) from Order to Book
A to-many relationship (ordersMade, keeping track of which weeks any one book was ordered) from Book to Order
Both these relationships have to-one inverses
I have been able to set up the adding of new books and orders and assigning any of the book objects to one particular order and displaying the books ordered for that date, but for my efforts I cannot get the books to keep track of the orders they were placed in.
I tried setting up a controller object with a button action to "addBooksOrderedObject" and "addOrdersMadeObject" to the respective objects (obtained via [books selection] where books is an outlet to the array controller in IB) but I keep getting errors saying the wrong selector was sent (to an NSControllerObjectProxy)
Any advice? Am I approaching this from the wrong angle? If so, I could use some suggestions for new ways to accomplish this.
Thanks in advance and if you need any more info from me, please ask.
10.6.6
XCode 3.2.5
What I have so far:
Core Data model with two entities, Book and Order
Only simple attributes set up for now, title and date, respectively
A to-many relationship (booksOrdered) from Order to Book
A to-many relationship (ordersMade, keeping track of which weeks any one book was ordered) from Book to Order
Both these relationships have to-one inverses
I have been able to set up the adding of new books and orders and assigning any of the book objects to one particular order and displaying the books ordered for that date, but for my efforts I cannot get the books to keep track of the orders they were placed in.
I tried setting up a controller object with a button action to "addBooksOrderedObject" and "addOrdersMadeObject" to the respective objects (obtained via [books selection] where books is an outlet to the array controller in IB) but I keep getting errors saying the wrong selector was sent (to an NSControllerObjectProxy)
Any advice? Am I approaching this from the wrong angle? If so, I could use some suggestions for new ways to accomplish this.
Thanks in advance and if you need any more info from me, please ask.
10.6.6
XCode 3.2.5