title: Disable UIButton programmatically
body: <p>I'm stumped at why this code isn't working. I have a login button that I want to disable when the user isn't logged in.</p>
  
  <p>I have a UIButton delared in my .h file like so:</p>
  
  <pre><code>   IBOutlet UIButton *myBtn;
  </code></pre>
  
  <p>I've set up a referencing outlet in Interface Builder to this button.</p>
  
  <p>In my .m file, I've tried:</p>
  
  <pre><code>[myBtn setEnabled: NO];
  </code></pre>
  
  <p>and </p>
  
  <pre><code>myBtn.enabled = NO;
  </code></pre>
  
  <p>But neither of these disable the button in the conditional statement I'm in. (I want to disable the login button when the user successfully logs in)</p>
  
  <p>I'm able to do this with two other buttons on the same screen, so I know the code is correct. I don't throw any errors, so I think the object exists. The references to myBtn change color in XCode, too, so it appears to be a valid reference.</p>
  
  <p>I must be missing something. What am I doing wrong here? (I'm a Windows developer, relatively new at Objective-C)</p>