• 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
NSWorkspaceWillPowerOffNotification events
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSWorkspaceWillPowerOffNotification events


  • Subject: NSWorkspaceWillPowerOffNotification events
  • From: "sunil prajapati" <email@hidden>
  • Date: Sat, 11 Aug 2007 19:56:31 +0530

Hi Guys,

I have written one application in cocoa and I m not showing my application in Dock because I have set LSUIElement as 1 in info.plist.
Now I want to capture the logout event,for that i m using "NSWorkspaceWillPowerOffNotification".
my code is:

    [[[NSWorkspace sharedWorkspace] notificationCenter] addObserver:self selector:@selector( workspaceWillPowerOff: ) name:NSWorkspaceWillPowerOffNotification object:[NSWorkspace sharedWorkspace]];


-(void)workspaceWillPowerOff:(NSNotification *)aNotification
{
        NSLog(@"Workspace");
        NSWorkspace *myWorkspace;
        myWorkspace = (NSWorkspace *)[aNotification object];
       
        NSRunAlertPanel(@"MyDocument",@"inside my document's workspaceWillPowerOff",@"Cancel",@"OK",nil);
       
    }


This works fine when i show my application in Dock,I able to capture the System Logout event.

But when I do not show my application in Dock by setting LSUIElement=1 then I unable to capture the System Logout event.


I don't know what is problem while setting the LSUIElement values.

Please help me how can come out of this problem?

Thanks,
sunil.
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: NSWorkspaceWillPowerOffNotification events
      • From: Quinn <email@hidden>
  • Prev by Date: Re: SMB CIFS AFP ETC... Server Path URL question
  • Next by Date: Re: NSWorkspaceWillPowerOffNotification events
  • Previous by thread: Re: SimpleDial & SCNetworkConnectionGetStatus
  • Next by thread: Re: NSWorkspaceWillPowerOffNotification events
  • Index(es):
    • Date
    • Thread