A few years ago, topics like Cocoa-Binding, Key-Value coding, Key-Value observing, Core Data were hot issues. Nowadays people have more interest in Core Animation, iPhone, OpenGL ES, and so on.
However, topics like Cocoa-binding, Key-Value coding/observation are always important and it is good to refresh knowledge on those.
So, recently while I was writing short sample program, I got to think about it again, and reminded me of Apple’s poor documentation on Cocoa Binding.
Cocoa Binding looks very simple. But the way it is explained is confusing. It is difficult to figure out what is wrong once your NIB/XIB file doesn’t work as expected for Cocoa Binding. So, you want to have some sample code for experiment.
Actually Apple provided one good sample…. but in text not actual code.
So, it takes time to figure out what says. It is the Master-Detail thing.
So, I would like share its full source code.
Additionally, I added an “addNew” action handler in MyDocument.m for testing. If I have a chance I would like to talk about it.