Reputation: 307
If I set an AVAudioSession category by enabling some options (by using setCategory:withOptions:error:), and later I call setCategory:error: , what happens to the previously set options?
If the answer is #1, what happens if the new category is not compatible with the enabled option? Is it automatically disabled by the system? I tried to read the documentation, but I couldn't find that particular info.
Thank you.
Upvotes: 1
Views: 3857
Reputation: 5680
The options don't keep their state when a category change occurs.
The categoryOptions property of your applications AVAudioSession shared instance is assigned a value of 0 when there are no options set using either of the setCategory methods currently available.
For example this line -
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayAndRecord error:nil];
is equivalent to -
AVAudioSessionCategoryOptions AVAudioSessionCategoryOptionsNone = 0;
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayAndRecord withOptions:AVAudioSessionCategoryOptionsNone error:nil];
Upvotes: 2