title: iOS - Recording from RemoteIO AudioUnit
body: <p>I'm trying to record from remoteIO and here is my callback. 
  I have an issue though... the code never goes into the 
  if (*ioActionFlags == kAudioUnitRenderAction_PostRender)</p>
  
  <p>How do I actually stop the recording such that it goes into kAudioUnitRenderAction_PostRender ? Very new to Core Audio so this may be a dumb question (I have a good feeling it is ;) )
  Many thanks. </p>
  
  <p>Pier. </p>
  
  <pre><code>static OSStatus RecordingCallback (
                                 void *                           inRefCon,
                                 AudioUnitRenderActionFlags * ioActionFlags,
                                 const AudioTimeStamp *           inTimeStamp,
                                 UInt32                           inBusNumber,
                                 UInt32                           inNumberFrames,
                                 AudioBufferList *                ioData) {
  EffectState *effectState = (EffectState*) inRefCon;
  
  // just copy samples
  UInt32 bus1 = 1;
  CheckError(AudioUnitRender(effectState-&gt;rioUnit,
                              ioActionFlags,
                              inTimeStamp,
                              bus1,
                              inNumberFrames,
                              ioData),
             "Couldn't render from RemoteIO unit");
  
  if (*ioActionFlags == kAudioUnitRenderAction_PostRender)
  {
      OSStatus result = ExtAudioFileWriteAsync(effectState-&gt;outputFile,inNumberFrames,ioData);
      if(result) printf("ExtAudioFileWriteAsync %ld \n", result);
  }
  return noErr;
  }
  </code></pre>