[audioSession setCategory:AVAudioSessionCategoryPlayAndRecord fooError: &fooError];
//Activate the session
[audioSession setActive:YES fooError: &fooError];
The warning i receive is
warning: ‘AVAudioSession’ may not respond to ‘-setActive:fooError:’
The warning already tells you what the problem is: The
AVAudioSessionmethods are called-setCategory:error:and-setActive:error:, not-setCategory:fooError:and-setActive:fooError:, respectively. You can change parameter names any way you want but not method names: