NSWorkspaceWillPowerOffNotification events
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