title: AVAudioRecorder [recorder record] always return NO
body: <p>I have a problem with recording functionality of my application:</p>
  
  <p>Recording directory is: /Document/Recordings/</p>
  
  <pre><code>[recordingSettings setValue:[NSNumber numberWithInt:kAudioFormatAppleIMA4] forKey:AVFormatIDKey];
  [recordingSettings setValue:[NSNumber numberWithFloat:44100.0] forKey:AVSampleRateKey]; 
  [recordingSettings setValue:[NSNumber numberWithInt:1] forKey:AVNumberOfChannelsKey];
  [recordingSettings setValue:[NSNumber numberWithInt:AVAudioQualityMax] forKey:AVEncoderAudioQualityKey];
  
  NSURL *url = [NSURL fileURLWithPath:[[GlobalRecording recordingDirectory] stringByAppendingPathComponent:currentFileName]];
  NSError *err = nil;
  AVAudioRecorder *aRecorder = [[AVAudioRecorder alloc] initWithURL:url settings:recordingSettings error:&amp;err];
  if( err ){
      NSLog(@"could not create a recorder: %@ %d %@", [err domain], [err code], [[err userInfo] description]);
      return;
  }
  
  [aRecorder setDelegate:self];
  aRecorder.meteringEnabled = YES;
  BOOL temp = [aRecorder prepareToRecord];
  if (temp) {
      NSLog(@"Prepare TRUE");
  } else {
      NSLog(@"Prepare FALSE");
  }
  temp = [aRecorder record];
  if (temp) {
      NSLog(@"Record TRUE");
  } else {
      NSLog(@"Record FALSE");
  }
  </code></pre>
  
  <p>The problem is [aRecorder prepareToRecord] always return TRUE, that will create a record file in system (/Document/Recordings). But [aRecorder record], this method to begin recording, always return FALSE. That will make the record file is 0 byte, can not do anything with it.</p>
  
  <p>I hope anyone have see this problem before and help me. Thanks.</p>