title: Use IBOutlet in Function in Header File
body: <p>could you please tell me how i can use IBOutlets in a function stored in the header file:</p>
  
  <p>.h file:</p>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  #import &lt;Foundation/Foundation.h&gt;
  #import &lt;AVFoundation/AVFoundation.h&gt;    
  
  @interface MainView : UIView &lt;AVAudioPlayerDelegate&gt;  {
  
          IBOutlet UILabel *SoundDescriptionLabel;
      IBOutlet UIBarButtonItem *StopSoundButton;
  
  }
  - (IBAction)PlayFatGuyWalking:(id)sender;
  - (IBAction)PlayRoadRunner:(id)sender;
  - (IBAction)ShowInfoPopup:(id)sender;
  - (IBAction)PlayChaosRunning:(id)sender;
  - (IBAction)PlaySadTrombone:(id)sender;
  - (IBAction)PlayBadJokeSound:(id)sender;
  - (IBAction)PlayHorrorSynth:(id)sender;
  - (IBAction)PlayLKWPeep:(id)sender;
  - (IBAction)PlayUiToll:(id)sender;
  - (IBAction)StopSound:(id)sender;
  
  
  
  AVAudioPlayer *theAudio;
  
  
  
  @end
  
  
  //PlaySound Function
  void playSound(NSString *filename,NSString *type){
      [theAudio stop];    
      NSString *path = [[NSBundle mainBundle] pathForResource:filename ofType:type];
      theAudio = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:path] error:NULL];
  //HERE I WOULD LIKE TO DO THIS:
  StopSoundButton.enabled=1;
  //END OF WHAT I'D LIKE TO DO
          [theAudio play];
      }
  </code></pre>
  
  <p>Please help me</p>
  
  <p>thx in advance</p>