Re: workspaceWillPowerOff error in Panther
Re: workspaceWillPowerOff error in Panther
- Subject: Re: workspaceWillPowerOff error in Panther
- From: "parag vibhute" <email@hidden>
- Date: Mon, 21 Jan 2008 17:17:04 +0530
Hi Willian,
Thanks for reply.
I want to catch the both delegates in my application which will
execute two different segments of code (i.e. if user has quit the
application from activity monitor then one segment of code will be
called and if user has shutdown the mac then other segment of code
will be called). Sequence of calling of delegates is fist
"workspacewillpoweroff" gets called & then
"applicationshouldterminate" in both the cases(i.e. application quit &
machine shutdown). Bcoz of this, only code segment for shutdown is
only becoming effective but not application quit which is my problem.
Or I may be missing something which u r saying,
Thanks,
Palav
On 1/21/08, William Squires <email@hidden> wrote:
> How about a semaphore? Whichever delegate gets called first checks
> the semaphore. If it hasn't been raised, it raises it, does its
> thing, then lowers it. If the other delegate also gets called, it
> sees the semaphore has been raised, and returns immediately. If the
> other delegate does not fire, then no prob, the work still gets done
> by the delegate that does fire.
>
> On Jan 17, 2008, at 10:18 AM, parag vibhute wrote:
>
> > Hi all,
> >
> > I am implementing cocoa application in which I am hidding its dock
> > icon
> > using info.plist.
> > I have implemented code for catching shutdown/restart/logout event
> > using *
> > workspaceWillPowerOff* delegate & application quit event(quitting from
> > activity monitor) using *applicationShouldTerminate *delegate.
> > In Tiger, when I run that application; I am able to catch
> > shutdown/restart/logout & application quit seperately & as I want.
> > But in
> > Panther, when I quit that application from activity monitor, both*
> > **applicationShouldTerminate
> > & **workspaceWillPowerOff *delegate methods gets called which is
> > unexpected
> > because ideally only *applicationShouldTerminate *should only get &
> > not *workspaceWillPowerOff.
> >
> > *I also tried signal handling but they did not work in Panther (but
> > very
> > well in Leopard). So not useful.
> >
> > Any solution to capture quit event for background cocoa application??
> >
> > Thanks,
> > Palav
> >
> > --
> >
> > 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 (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:
> > 40satx.rr.com
> >
> > This email sent to email@hidden
>
>
--
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 (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