• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: how to centralize functionality more elegantly?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.
  • Follow-Ups:
    • Re: how to centralize functionality more elegantly?
      • From: Andreas Mayer <email@hidden>
    • Re: how to centralize functionality more elegantly?
      • From: Andy Lee <email@hidden>
References: 
 >Re: how to centralize functionality more elegantly? (From: Andreas Mayer <email@hidden>)

  • Prev by Date: Re: Objects between threads
  • Next by Date: Re: how to centralize functionality more elegantly?
  • Previous by thread: Re: how to centralize functionality more elegantly?
  • Next by thread: Re: how to centralize functionality more elegantly?
  • Index(es):
    • Date
    • Thread