title: how to find Login & logout events in mac?
body: <p>I am fresher for this application development field. I am tried to get notifications during user login &amp; logout events. I have tried with <code>NSWorkSpaceNotifications</code>, but it does not working for me. </p>
  
  <p>Can somebody help me please.</p>
  
  <pre><code>-(void)logInLogOutNotifications{
      NSNotificationCenter *notCenter;
      notCenter = [[NSWorkspace sharedWorkspace] notificationCenter];
      [notCenter addObserver:self
                    selector:@selector(observerMethod)
                        name:NSWorkspaceWillPowerOffNotification object:nil]; 
  }
  
  -(void)observerMethod:(NSNotification *)senderNotification;{
  
      NSLog(@"System Logout Notification is called***********************");
  
  }
  </code></pre>