title: Creating AVAudioRecorder Instance in IPhone
body: <p>I am using the following code in my controller implementation file to create the instance of AVAudioRecorder. </p>
  
  <pre><code>-(NSError *) createAVAudioRecorder 
  {
   [recorder release];
   recorder = nil; 
  
   NSDate *now = [NSDate dateWithTimeIntervalSinceNow:0]; 
   NSString *calDate = [now description]; 
  
   NSString *fileName = [NSString stringWithFormat:@"myfile"]; 
  
  
   NSLog(@"%@\%@",DOCUMENTS_FOLDER,calDate); 
  
   NSString *recorderFilePath = [[NSString stringWithFormat:@"%@/%@.caf",DOCUMENTS_FOLDER, fileName] retain]; 
  
   NSURL *url = [NSURL fileURLWithPath:recorderFilePath]; 
  
   NSMutableDictionary *recordSettings = [[NSMutableDictionary alloc]init]; 
  
   NSError *err = nil; 
  
   recorder = [[AVAudioRecorder alloc] initWithURL:url settings:recordSettings error:&amp;err]; 
  
   return nil; 
  
  }
  </code></pre>
  
  <p>And it keep giving me the following error: </p>
  
  <pre><code>Undefined symbols:
    "_OBJC_CLASS_$_AVAudioRecorder", referenced from:
        objc-class-ref-to-AVAudioRecorder in myapp.o
  ld: symbol(s) not found
  collect2: ld returned 1 exit status
  </code></pre>
  
  <p>The header file looks like this: </p>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  #import &lt;AVFoundation/AVFoundation.h&gt;
  #import &lt;CoreAudio/CoreAudioTypes.h&gt; 
  
  
  
  @interface MyController : UIViewController&lt;AVAudioRecorderDelegate&gt; {
  
   IBOutlet UIButton *recordButton; 
   AVAudioRecorder *recorder; 
  
  }
  
  -(IBAction) record: (id) sender; 
  -(NSError *) createAVAudioRecorder; 
  
  
  @end
  </code></pre>