title: Set state of NSMenuItem to On
body: <p>I have created a menu bar app and I would like when you click on one of the menu bar items it toggles between the off state and the on state (ticked and unticked) but I am struggling to do this in code. Does anyone have any ideas about how this can be achieved?</p>
  
  <p>I can see that I can set it in the Attributes Inspector but i would like to change it to On/Off once it has been pressed.</p>
  
  <p>Thanks
  Miles</p>