• 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: stopping an application
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: stopping an application


  • Subject: Re: stopping an application
  • From: Andrew Farmer <email@hidden>
  • Date: Mon, 13 Apr 2009 00:47:30 -0700

On 12 Apr 09, at 23:55, Arjun SM wrote:
Use the 'do shell script' command
do shell script kill -9 PID
That should work.

No, actually, don't do that.

We are discussing Cocoa programming here. Running an Applescript that executes a shell script command that wraps a system call is an incredibly inefficient approach to the problem. (The correct way to do this would be using the kill() syscall... but keep reading.)

In any case, that's a terrible way to quit an application. If the application has any files open, it'll quit without getting a chance to save them properly - in particular, it won't prompt the user to save changes, which is a really fast path to making the user angry at your program.
_______________________________________________


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: 
 >Re: stopping an application (From: Greg Guerin <email@hidden>)
 >Re: stopping an application (From: "James W. Walker" <email@hidden>)
 >Re: stopping an application (From: Arjun SM <email@hidden>)

  • Prev by Date: Re: stopping an application
  • Next by Date: Re: How to create an ISO disc image
  • Previous by thread: Re: stopping an application
  • Next by thread: Re: stopping an application
  • Index(es):
    • Date
    • Thread