Help with Relationships

Discussion in 'Mac Programming' started by paul.b.davis, Mar 19, 2011.

  1. paul.b.davis macrumors 6502


    Oct 24, 2007
    Over the hills and far away...
    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.

    XCode 3.2.5
  2. TheShinyMac macrumors 6502a


    Apr 3, 2009
    Totaly misleading threat title in the Forum Spy.... sorry i can't help
  3. paul.b.davis thread starter macrumors 6502


    Oct 24, 2007
    Over the hills and far away...
    Yeah, I realized that after I posted it, without the context of the programming forum, it takes a totally new meaning.
  4. chrono1081 macrumors 604


    Jan 26, 2008
    Isla Nublar
    I loled at this :D

Share This Page