title: Can't locate parent view of UIButton
body: <p>I have two UIButtons that I have programmatically created and added as subviews to my custom UIView. The problem I'm having is that the code that I have that adds them as subviews is called repeatedly, and I'd only like them to be added once.</p>
  
  <p>To do this, I have added this check:</p>
  
  <pre><code>if (![calibrateButton isDescendantOfView:self] &amp;&amp; ![drainButton isDescendantOfView:self]) {
      [self addSubview:drainButton];
      [self addSubview:calibrateButton];
  }
  </code></pre>
  
  <p>The issue is that these buttons keep being added as subviews. So if they're not descendants of my custom view, then who could they be descendants of?</p>
  
  <p>Doing an NSLog of [calibrateButton.superView description] shows that it is indeed my custom view, which leaves me lost.</p>
  
  <p>What is the proper way of ensuring these buttons only get added once, and how can I decipher who their parent view really is?</p>