I am trying to create a document-based beer review application that allows you to enter your notes. I built the model in Core Data and the view in Interface Builder. Following some Xcode 3-based tutorials, I was told to connect the new NSArrayController to the managedObjectContext of the file owner. If I try to do this in Xcode 4, a circular exclamation mark will appear around the inspector for NSArrayController next to “Model Key Path”.
I can load the .xib file in Interface Builder in Xcode 3, make this connection, and then build it in Xcode 4 and run, but each field causes a validation error.
The model has an object called Scoresheet, which has a property called date, which is NSDate. But if I bind it to an NSDatePicker value and try to save it to disk, it says that I have "multiple validation errors." How can it be ? They are both NSDates, aren't they? In fact, I have the same problem with binding to everything; none of my user interface objects will work with my model.
The only thing I can understand is that there is something wrong with the connection between the file owner and NSArrayController.
At the moment, I have not written any code because I understand that I do not just need to bind the user interface fields and the main data. Is it different because I use a document based application? (I cannot get it to work in a single window application.)
The answer "do not use master data" will not be productive; I know that I can just return to a regular data object. I would like to understand this in the context of master data, if possible.
TIA!
(Update: This question seems to displease many people. I consulted the Zarra book on basic data, the Hillegas Cocoa programming book, and two O'Reilly books. They all seem to be based on Xcode 3.)
sj660
source share