title: How to detect whether mic available in device(iPhone/iPad)- Objective C
body: <p>In my <code>iOS</code> application, I want to show an <code>Alert</code>, if <code>Mic is not available in the device</code>.</p>
  
  <p>How can I check this ?</p>
  
  <p>I have tried this-</p>
  
  <pre><code> -(void)checkMic
   {
    UInt32 sessionCategory = kAudioSessionCategory_RecordAudio;
     OSStatus status = AudioSessionSetProperty (kAudioSessionProperty_AudioCategory, sizeof (sessionCategory), &amp;sessionCategory);  //..always seems to return OK..
     status = AudioSessionSetActive (true);
     if(status)
     {
        //mic is not available
      }
    }
  </code></pre>
  
  <p>But this code is showing an error with message - deprecated.</p>