Re: Automatically terminating application
Re: Automatically terminating application
- Subject: Re: Automatically terminating application
- From: William Squires <email@hidden>
- Date: Sun, 15 Nov 2009 17:46:17 -0600
On Oct 7, 2009, at 9:57 PM, Wim Lewis wrote:
On Oct 7, 2009, at 1:44 PM, Daniel Ketel wrote:
[...] I must have done something wrong, the application seems to
get confused or I don't know what. The system itself still is
running, but somehow the application is ignoring ANY input, but
since it covers up the whole screen and ignores the input, I have
no means of terminating the application. I can't switch to
Activity Monitor or back to xcode or anything...
[...] So I though there might be something built into xcode (or
something in the xcode-package) like a timer to terminate an
application. For example before starting my application in debug
mode I would set the timer to say 10 seconds, and after 10 seconds
the application will be killed automagically, regardless of what
it is doing. Would help me a lot, since I wouldn't have to force-
kill the whole system (forced shutdown...). Any ideas?
You could use the alarm() syscall. This will schedule a SIGALARM to
be sent to your process in some number of seconds. If you don't
have a signal handler set up for that signal (and by default, you
don't), then your program will be terminated. Just put a line like
"alarm(10);" near the beginning of main().
(If you have another machine available, even a non-Mac, then using
ssh to log in and kill the process is probably the easiest route,
as Jens Alfke suggests.)
But don't forget that you need to enable remote login via the Sharing
system preferences panel or this'll get nowhere, methinks!
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40satx.rr.com
This email sent to email@hidden
_______________________________________________
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