title: Record Audio in my App Errors
body: <p>I am trying to let the users record their voice in my app and I am following this <a href="http://www.techotopia.com/index.php/Recording_Audio_on_an_iPhone_with_AVAudioRecorder_%28iOS_6%29" rel="nofollow noreferrer">tutorial</a>. This is the code in viewDidLoad:</p>
  
  <pre><code>NSArray *dirPaths;
  NSString *docsDir;
  
  dirPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
  docsDir = dirPaths[0];
  
  NSString *soundFilePath = [docsDir
                             stringByAppendingPathComponent:@"sound.caf"];
  
  NSURL *soundFileURL = [NSURL fileURLWithPath:soundFilePath];
  
  NSDictionary *recordSettings = [NSDictionary
                                  dictionaryWithObjectsAndKeys:
                                  [NSNumber numberWithInt:AVAudioQualityMin],
                                  AVEncoderAudioQualityKey,
                                  [NSNumber numberWithInt:16],
                                  AVEncoderBitRateKey,
                                  [NSNumber numberWithInt: 2],
                                  AVNumberOfChannelsKey,
                                  [NSNumber numberWithFloat:44100.0],
                                  AVSampleRateKey,
                                  nil];
  
  NSError *error = nil;
  
  self.recorder = [[AVAudioRecorder alloc]
                    initWithURL:soundFileURL
                    settings:recordSettings
                    error:&amp;error];
  
  if (error)
  {
      NSLog(@"error: %@", [error localizedDescription]);
  } else {
      [self.recorder prepareToRecord];
  } 
  </code></pre>
  
  <p>I am getting 6 errors:</p>
  
  <p><img src="https://i.stack.imgur.com/PjJIj.png" alt=""></p>
  
  <p>I know the errors are coming from the the code in viewDidLoad because when I comment out that code the errors go away. What do the errors mean and how do I fix it?</p>