Re: The Problems with NSController
Re: The Problems with NSController
- Subject: Re: The Problems with NSController
- From: David Remahl <email@hidden>
- Date: Sun, 26 Oct 2003 16:49:17 +0100
On 26 okt 2003, at 16.37, Andreas Mayer wrote:
Am Sonntag, 26.10.03 um 15:42 Uhr schrieb Aaron Hillegass:
5. It relies on unsavory hacks to the runtime system. For a
controller to know about changes to a model object, your accessor
methods need to notify it of the change. In EOF, the developer added
a call to [self willChange] to each set method in his model objects.
NSController (which doesn't trust you to do this) replaces your class
with a secret subclass that does the "right" thing.
I just wondered about this point when reading the documentation.
Too bad. Sounded like a great concept.
It should be noted, though, that this behaviour is optional. You can
choose to disable automatic "KV Observer Notification" (+[NSObject
automaticallyNotifiesObserversForKey:]), and then you have to call
-willChangeValueForKey: to give manual notification of value changes.
I have not spent enough time actually working with NSController to have
formed an opinion on wether it is well designed or not.
/ Regards, David
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.