title: Programing button in mac objective-c
body: <p>i have some code here:</p>
  
  <pre><code>-(void)handleButton {
      NSLog(@"hello");
  }
  </code></pre>
  
  <p>and i wanted to connect that function to occur when i press a button that is named, <code>theButton</code>
  I know that you can link things in the interface programer but that does not let me use functions, so how would i do this so i can use functions???</p>
  
  <p>i've tried to use codes like this one:</p>
  
  <pre><code>[theButton setTarget:self];
  [theButton setAction:@selector(handleButton:)];
  </code></pre>
  
  <p>to set the button to call that function but when i do it gives me an error that <code>theButton</code> is not declared, i know this is probably dumb and has a simple answer but i cant figure it out.</p>