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: Sat, 7 Sep 2002 18:02:38 +0200
On Saturday, September 7, 2002, at 02:07 , Andreas Mayer wrote:
Is the "(MainController*)" part actually necessary? Some code in my
program works with the equivalent of:
Without it you should get a compile time warning - as Matt stated in his
original post:
In order to call these functions I
typecast (I don't have to, but it's nice to eliminate warnings).
That's unless you overwrite an already existing method of NSApplication,
of course ...
Nope twice. Since the original code was, IIRC, using the app _delegate_,
the part of "overwrite an already existing method of NSApplication" makes
no sense.
And since -delegate returns an id, you can send it *any* message without a
warning.
The cast has its use though -- it would never get rid of any warning;
quite the opposite: it would *cause* a warning in case you send a message
for which the MainController has no method (more precisely, which is not
declared in its interface).
---
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.