Failed when calling [AVAudioSession setPreferredInputNumberOfChannels]

I have got an error like below:

The operation could not be completed.
(OSStatus error -50.)

when calling

[AVAudioSession setPreferredInputNumberOfChannels:count error:outError]

with count=1 after set AVAudioSession to active. But sometimes it works fine. Can anybody tell me why?

Failed when calling [AVAudioSession setPreferredInputNumberOfChannels]
 
 
Q