title: How find out if I'm an NSButton with buttonType NSSwitchButton?
body: <p>I'm subclassing NSButtonCell to customize the drawing (customizable theme). I'd like to customize the way checkboxes and radio buttons are drawn.</p>
  
  <p>Does anyone know how to detect whether a button is a checkbox or radio button?</p>
  
  <p>There is only -setButtonType:, no getter, and neither -showsStateBy nor -highlightsBy seem to give any unique return values for checkboxes that don't also apply to regular push buttons with images and alternate images.</p>
  
  <p>So far I've found two (not very pretty) workarounds, but they're the kind of thing that'd probably get the app rejected from MAS:</p>
  
  <ol>
  <li><p>Use [self valueForKey: @"buttonType"]. This works, but since the method is not in the headers, I presume this is something Apple wouldn't want me to do.</p></li>
  <li><p>Override -setButtonType: and -initWithCoder: to keep track of the button type when it is set manually or from the XIB. Trouble here is the XIB case, because the keys used to save the button type to disk are undocumented. So again, I'd be using private API.</p></li>
  </ol>
  
  <p>I'd really like this to be a straight drop-in replacement for NSButtonCell instead of forcing client code to use a separate ULIThemeSwitchButtonCell class for checkboxes and a third one for radio buttons.</p>