• 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: programatically quit a program
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: programatically quit a program


  • Subject: Re: programatically quit a program
  • From: Ricky Sharp <email@hidden>
  • Date: Thu, 28 Aug 2008 16:04:13 -0500


On Aug 28, 2008, at 3:49 PM, Ken Thomases wrote:

On Aug 28, 2008, at 3:38 PM, Wayne Shao wrote:

But the terminate function takes an id for sender. What shall I use?

In this case, you're the sender so you can pass "self". Or, if you're within an action method (IBAction) you can forward the sender that was passed to you.


In truth, I don't believe the -[NSApplication terminate:] method makes any use of its sender parameter. It's only declared that way to match the signature of an action method.

It's a matter of personal style, but I always use 'self'.

My action methods are typically invoked in multiple ways: directly by some control (where the sender is that control); by scripting engine where the sender is the 'script' object; and by speech recognition engine that simulates actions.

In my action methods, it's nice to sometimes log info out about the sender. Thus, I never use nil.

___________________________________________________________
Ricky A. Sharp         mailto:email@hidden
Instant Interactive(tm)   http://www.instantinteractive.com



_______________________________________________

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


References: 
 >programatically quit a program (From: "Wayne Shao" <email@hidden>)
 >Re: programatically quit a program (From: Ken Thomases <email@hidden>)

  • Prev by Date: Remove an object from a defaults suite?
  • Next by Date: Re: Undocumented Leopard support for overlapping sibling views
  • Previous by thread: Re: programatically quit a program
  • Next by thread: Re: programatically quit a program
  • Index(es):
    • Date
    • Thread