Re: NSController revisited
Re: NSController revisited
- Subject: Re: NSController revisited
- From: Óscar Morales Vivó <email@hidden>
- Date: Tue, 4 Nov 2003 15:52:41 +0100
Just chiming in with some opinions:
On 4 Nov 2003, at 15:25, Aaron Hillegass wrote:
[...]
3) "It eschews the delegation design pattern."
In particular, I still believe that NSArrayController needs a
delegate outlet. Here are the minimal delegate methods it needs:
- (id)arrayController:(NSArrayController *)ac
willAddNewObject:(id)newObj;
This method would give you a chance to initialize a new object with
default values (or replace it) before it is displayed
- (NSIndexSet *)arrayController:(NSArrayController *)ac
shouldChangeToSelection:(NSIndexSet *)is
This method would give you a chance to control whether the selection
was allowed to change. It would also give you a chance to update the
parts of your UI that are not NSController-driven.
Given these two, you can imagine several more. When automatic undo
is added, you'll probably also want things like:
- (NSString *)undoActionNameForChange:(NSKeyValueChange)kvc
ofKey:(NSString *)aKey forObject:(id)anObj;
I hadn't given thought about that, but after seeing the example Aaron
gives, I'm overwhelmed about its potential just after thinking about it
for 30 seconds.
I don't think it would be that hard to implement it (might even try my
hand in it if no one else does).
Already impatient to see this implemented ;o)
[...]
5) "No support for relational databases."
Apple still hasn't come up with an elegant way to access relational
databases, and it is a source of great frustration for me and
everyone else who tries to sell services to the enterprise. We keep
asking, and no answers seem to come. So we ask louder. The result is
ridiculous diatribes like mine. I'm sorry that my frustration was
misdirected at NSController -- it is a good addition to Cocoa and will
get even better with time.
And if Apple doesn't do it, I'd think it's a great opportunity for
shareware developers and the like. Obviously having good docs about
'how to build your own NSController subclass' should help (I do guess
they are forthcoming ;o). I know I'd pay some good for a
XXDBController class if it works as promised.
Hope that helps.
_______________________________________________
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.