NSManagedObjects, for better or worse, don't create setters or getters in 10.4, and looks like 10.5 either. They do it all with KVC. What it means is that, with managed objects: // Works!
movie.title = @"The Hudsucker Proxy";
// also works!
[movie setValue: @"The Hudsucker Proxy" forKey: @"title"];
// Doesn't work unless you made the function.
[movie setTitle: @"The Hudsucker Proxy"];
Long answer:
If you've got your heart set on setTitle:, the 10.4 way would be making the method yourself, and using setPrimativeValue:forKey:. You'd have to diddle about to verify that willChangeValueForKey: and didChangeValueForKey: were called for you or not. It's pretty messy, and there's probably a better way that I don't know.
Short answer:
Dot notation and setValue:forKey: are your friends, especially with MO.
by Blain — Nov 04
NSManagedObjects, for better or worse, don't create setters or getters in 10.4, and looks like 10.5 either. They do it all with KVC. What it means is that, with managed objects:
// Works! movie.title = @"The Hudsucker Proxy"; // also works! [movie setValue: @"The Hudsucker Proxy" forKey: @"title"]; // Doesn't work unless you made the function. [movie setTitle: @"The Hudsucker Proxy"];
Long answer:
If you've got your heart set on setTitle:, the 10.4 way would be making the method yourself, and using setPrimativeValue:forKey:. You'd have to diddle about to verify that willChangeValueForKey: and didChangeValueForKey: were called for you or not. It's pretty messy, and there's probably a better way that I don't know.
Short answer:
Dot notation and setValue:forKey: are your friends, especially with MO.