FROM : Simon
DATE : Sun Nov 18 21:42:30 2007
Hi
I want to extend the core-data application from the
NSPersistentDocument core data tutorial with some additional
functionality. I've added a sheet to manage a tree of departements.
The Department entity has two additional relationships, a parent and
an inverse children relationship. I've successfully managed to bind an
NSTreeController and an NSOutlineView. Now, I want to add an
NSPopupButton to the new object sheet which allows to choose the
department for a new employee.
However, if I launch the application and add some departments and then
try to add a new employee, the NSPopupButton is not updated (that is,
it stays empty). If I save the document, reopen it and add a new
employee, the popup button is properly populated. Below the changes
I've made in the new Employee Sheet NIB.
* NSArrayController for the departements
** managedObjectContext bound to managedObjectContext of File's Owner
* NSPopupButton for the departements
** Content bound to array controller arrangedObjects
** Content Values bound to array controller arrangedObjects key path
name
** Selected Object bound to Object Controller arrangedObjects key path
department
If I bind the array controller's managedObjectContext to the
documentManagedObjectContext of File's Owner, the popup menu is
populated (I can't complete the sheet because the department is from a
different managed object context and that is obviously not allowed).
How can I make sure that the changes from the departments sheet are
visible in the new object sheet's popup button?
Thanks
Simon
DATE : Sun Nov 18 21:42:30 2007
Hi
I want to extend the core-data application from the
NSPersistentDocument core data tutorial with some additional
functionality. I've added a sheet to manage a tree of departements.
The Department entity has two additional relationships, a parent and
an inverse children relationship. I've successfully managed to bind an
NSTreeController and an NSOutlineView. Now, I want to add an
NSPopupButton to the new object sheet which allows to choose the
department for a new employee.
However, if I launch the application and add some departments and then
try to add a new employee, the NSPopupButton is not updated (that is,
it stays empty). If I save the document, reopen it and add a new
employee, the popup button is properly populated. Below the changes
I've made in the new Employee Sheet NIB.
* NSArrayController for the departements
** managedObjectContext bound to managedObjectContext of File's Owner
* NSPopupButton for the departements
** Content bound to array controller arrangedObjects
** Content Values bound to array controller arrangedObjects key path
name
** Selected Object bound to Object Controller arrangedObjects key path
department
If I bind the array controller's managedObjectContext to the
documentManagedObjectContext of File's Owner, the popup menu is
populated (I can't complete the sheet because the department is from a
different managed object context and that is obviously not allowed).
How can I make sure that the changes from the departments sheet are
visible in the new object sheet's popup button?
Thanks
Simon
| Related mails | Author | Date |
|---|---|---|
| Simon | Nov 18, 21:42 | |
| Simon | Nov 19, 17:29 |






Cocoa mail archive

