Re: how to centralize functionality more elegantly?
Re: how to centralize functionality more elegantly?
- Subject: Re: how to centralize functionality more elegantly?
- From: Ondra Cada <email@hidden>
- Date: Thu, 5 Sep 2002 21:56:39 +0200
On Thursday, September 5, 2002, at 07:14 , Matt Neuburg wrote:
[(MainController*) [NSApp delegate] showStatus: @"You cannot do that."]
;
Is there a more elegant way to be doing this? m.
Definitely:
[[NSNotificationCenter defaultCenter]
postNotification:@"ShowStatusNotification" object:@"You can do this"];
Also, you might consider
[NSApp sendAction:@selector(showStatus:) to:nil from:@"You cannot do that"
];
which is also kind of more flexible than your original solution (the
method can be catched by a front view/window/controller if applicable, if
not, it would fall through to the NSApp delegate), but is this very case
it seems superfluous, and using the string argument as a sender is even a
tad on the unclean side.
---
Ondra Cada
OCSoftware: email@hidden
http://www.ocs.cz
private email@hidden
http://www.ocs.cz/oc
_______________________________________________
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.