title: Mac - Get Battery/Charging Status (Plugged in or not)
body: <p>I'm building a Mac OSX app that needs to poll a server every minute, or even less if the user wishes. Unfortunately the service doesn't support push...</p>
  
  <p>Anyways, I would like to provide two options to the user:</p>
  
  <ol>
  <li>Polling interval on battery Polling</li>
  <li>interval while charging</li>
  </ol>
  
  <p>How would I get the state of the charger in Objective C? I don't really care about the actual percentage, only if the laptop is plugged in or not. Obviously, this doesn't matter for desktops, so hopefully there is a solution that works for laptops and desktops.</p>