Hi Bill,

Sorry for late reply.

As you suggested, I have implemented signal handling mechanism to trap the
"application crash" & it is working fine. Thanks.

I have one more problem. I am using Tiger OS. Suppose user quits the
application by using "Force Quit" option from activity monitor then since it
sends "kill" signal, I can not catch that signal. So in this case, what will
you suggest? (I noticed that if user pops up "Force quit" window by pressing
ctrl+option+Esc & force quits the application from there, then it sends
"SIGTERM" signal which can be caught but can't catch force quit from the
activity monitor)

Thanks,
Palav


On Fri, Feb 8, 2008 at 10:00 PM, Bill Garrison <[EMAIL PROTECTED]>
wrote:

>
> On Feb 8, 2008, at 8:04 AM, parag vibhute wrote:
>
> > I thought about the signal handler but not sure that any of those 30
> > signals
> > which man page of signal() mentions always get called on application
> > crash.
>
> I just spent some time writing crash detection code.  You can count on
> a signal being sent if the application's process terminates
> unexpectedly.  Either one of SIGBUS and SIGSEGV will be sent in most
> of crashes, but you could definitely see these other signals depending
> on the crash condition: SIGFPE, SIGILL, SIGEMT, SIGSYS.
>
> You may also want to implement the NSExceptionHandler's -
> exceptionHandler:shouldLogException:mask: delegate to catch exceptions
> that might also warrant terminating the app.
>
> Exceptions that aren't handled internally will eventually propagate to
> the NSApplication object as "unhandled" exceptions.   Implementing -
> exceptionHandler:shouldLogException:mask: (or
> shouldHandleException:mask:) gives you an opportunity to catch those
> events and take an action.
>
> I found this Jose Cruz O'Reilly article helpful in learning about
> exception handling:
> <
> http://www.macdevcenter.com/pub/a/mac/2007/07/31/understanding-exceptions-and-handlers-in-cocoa.html
>  >
>
> Bill
>
>


-- 

There are many things in your life that will catch your eye but only a few
will catch your heart....pursue those'.
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to