views:

298

answers:

2
A: 

add:

  • Recessed Button (D…
  • Recessed Button (N…

Are those “New” and “Delete”?

If so, you left your Delete button connected to the add: action. Connect it to remove: instead.

(Also, you should use gradient buttons with NSAddTemplate and NSRemoveTemplate images instead of recessed buttons with verbal labels. See the Accounts pane in System Preferences for an example of this in action, and the HIG for a description of what recessed buttons are supposed to be used for.)

Peter Hosey
No the D is for a Different button called done.
Joshua
A: 

I have figured it out, so I will post the answer to help all those who may have the same problem. To fix it simply do this.

  1. Bind the NSTreeController's managedObjectContext directly to the managedObjectContext property of the appdelegate, and remove the whole NSArrayController. NSTreeController can add/remove items from the managedObjectContext, but not from the NSArrayController's arrangedObjects as it is read-only.

  2. Now connect the add button to the Tree Controllers add: connection.

  3. Finally connect the remove button to the Tree Controllers remove: connection.

Joshua