I’m following the project in the book using the latest version of xcode 3.2.1.
The application template has created an AppDelegate object named “Grokking_Recipes_AppDelegate” with the following ivars:
NSWindow *window; NSPersistentStoreCoordinator *persistentStoreCoordinator; NSManagedObjectModel *managedObjectModel; NSManagedObjectContext *managedObjectContext;
These properties are declared as follows:
@property (nonatomic, retain) IBOutlet NSWindow *window; @property (nonatomic, retain, readonly) NSPersistentStoreCoordinator *persistentStoreCoordinator; @property (nonatomic, retain, readonly) NSManagedObjectModel *managedObjectModel; @property (nonatomic, retain, readonly) NSManagedObjectContext *managedObjectContext;
The problem comes in section 2.6 “Adding the NSArrayController Objects”. Step #5 says to use the Bindings tab of the inspector to bind the ManagedObjectContext to the AppDelegate with the model key path of managedObjectContext.
IB simply won’t let me do this, I believe because the managedObjectContext property is defined as read only in the AppDelegate. There are no managedObjectContext’s that I can bind to unless I am supposed to drag one from the object library.
Thanks for your help.