I've made a simple document-based app using core data that should save a string and a double value. The string should be entered in a text field. Its value is binded to my object controller player with controller key "selection" and model key path "name". The double type number should be entered in another text field then by pressing the "Go" button a label, with a value binded to player with controller key "selection" and model key path "score", should display the number.
The object controller's Managed Object Context is binded to the File's Owner with the model key path "managedObjectContext". In the attributes inspector I've changed the object controller's mode to "Entity Name", entered "Player" in the Entity Name field and turned on "Prepares Content" checkbox.
In the "Document.m" I check if a new document was created and if yes I make an NSObjectController newObj and set a default value for the key "name". The program saves the name perfectly, showing it in the the text field every time I open a saved document, but it seems that the number is not being save, because the label that should display the number is always blank.
How do I fix it? You can download the project here: https://www.dropbox.com/sh/zyvpoj5uwj71okn/mDdV7xoVbk
The object controller's Managed Object Context is binded to the File's Owner with the model key path "managedObjectContext". In the attributes inspector I've changed the object controller's mode to "Entity Name", entered "Player" in the Entity Name field and turned on "Prepares Content" checkbox.
In the "Document.m" I check if a new document was created and if yes I make an NSObjectController newObj and set a default value for the key "name". The program saves the name perfectly, showing it in the the text field every time I open a saved document, but it seems that the number is not being save, because the label that should display the number is always blank.
How do I fix it? You can download the project here: https://www.dropbox.com/sh/zyvpoj5uwj71okn/mDdV7xoVbk