• 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
The Magic Delegate
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

The Magic Delegate


  • Subject: The Magic Delegate
  • From: Paul Sargent <email@hidden>
  • Date: Fri, 16 Nov 2007 14:01:28 +0000

I'm looking at the Cocoa CoreData Application template in Xcode 3, and something has me a little puzzled.

The only class in the template is <projectname>_AppDelegate. It's a bit of a stretch in naming because the only delegate method in it is applicationShouldTerminate:, but sure enough, its set as the NSApplication delegate when the App is run, and applicationShouldTerminate: does its stuff.

Why question is how?

There are no calls to setDelegate: in the project, and IB shows no connection to the delegate outlet of the application instance.

So how is this class being set as the delegate for the NSApplication?
Is there another method of doing this that I don't know about?
Is it magic?

Paul (Trying to get his head around some of the stuff behind the curtain)
_______________________________________________


Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: The Magic Delegate
      • From: Johan Kool <email@hidden>
  • Prev by Date: Re: Best way of identifying duplicate files in Cocoa
  • Next by Date: Re: Problems with iTunes Plus files and ExtAudioFile API
  • Previous by thread: Re: Best way of identifying duplicate files in Cocoa
  • Next by thread: Re: The Magic Delegate
  • Index(es):
    • Date
    • Thread