I’m building a really simple Core Data app in XCode 4. There’s an entity model with just one entity (Employee) and just one attribute (name).
In IB I’ve added a default Table View to display the employees, two buttons (one to add an employee and another to delete an employee) and an ArrayController.
It is my understanding that the ArrayController’s managedObjectContext somehow needs to be connected to the one that is initialised by the App Delegate. I can see the code for initialising the context but IB does not let me connect to it.
How do I do this connection?
Many thanks.
How does Interface Builder not allow you connect it? Bindings are not the same as
IBOutletsin Interface Builder context. If file owner is instance ofAppDelegate(which always has initial managed object context) you just should defineNSArrayController‘s managedObjectContext binding’s object asFile's ownerand setmanagedObjectContextas its model path.