'Prepare Content' not working for Object Controllers ?
'Prepare Content' not working for Object Controllers ?
- Subject: 'Prepare Content' not working for Object Controllers ?
- From: Guillaume Laurent <email@hidden>
- Date: Thu, 26 Feb 2009 21:36:08 +0100
Hi,
I seem to be having a problem getting the 'Prepares Content' flag to
work in the case of an NSObjectController.
I'm trying to have a single Core Data entity bound to a couple of
widgets (the entity has two attributes, a string and an int, and I've
created a simple UI with Interface Builder with two text fields each
bound to one of the attributes).
I've also added an NSObjectController, attached it to the Core Data
entity, and toggled the 'Prepares Content' flag.
(what I'm trying to apply is described here, 3rd paragraph :
http://developer.apple.com/documentation/Cocoa/Conceptual/NSPersistentDocumentTutorial/04_Department/chapter_5_section_7.html#/
/apple_ref/doc/uid/TP40002832-SW5 )
But when running the application, both text fields display "no
selection" and are not editable.
I've also tried making a similar change on the
MigratingDepartmentAndEmployees
sample from this (very helpful) page :
http://homepage.mac.com/mmalc/CocoaExamples/controllers.html
The sample has a model with a Department entity which is meant to be
instantiated only once, and has an NSObjectController bound to it.
However the code manually creates the instance of Department, but
trying to comment out the manual creation and toggling the 'Prepares
Content' flag for the NSObjectController (and disabling the 'Content
Object' binding) yields exactly the same result : the text fields
bound to the Department attribute show 'No selection'.
So, is there something else to do to get the NSObjectController to
create the Core Data entity it's meant to control ?
While I'm at it, all examples I could find show that the controller
key to bind an NSObjectController's value is 'selection'. Shouldn't it
be 'content' ?
Thanks for your help,
--
Guillaume
http://telegraph-road.org
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden