objective c - AudioSessionSetProperty (kAudioSessionProperty_OverrideCategoryMixWithOthers) deprecated -


i used

 uint32 dosetproperty = 0;     osstatus status1 = audiosessionsetproperty (kaudiosessionproperty_overridecategorymixwithothers, sizeof(dosetproperty), &dosetproperty); 

i saw become deprecated , changed with:

nserror *setcategoryerror = nil; if (![[avaudiosession sharedinstance] setcategory:avaudiosessioncategoryplayback               withoptions:avaudiosessioncategoryoptionmixwithothers                     error:&setcategoryerror]) {     // handle error } 

after doing that, remotecontrolreceivedwithevent not called longer.

in both version did:

success &= [[avaudiosession sharedinstance] setactive:yes error:&error]; 

did encounter kind of problem?

did import avfoundation?

#import <avfoundation/avfoundation.h> 

and did forget set delegate?

[[avaudiosession sharedinstance] setdelegate:self]; [[avaudiosession sharedinstance] setactive: yes error: nil]; 

Comments

Popular posts from this blog

Hatching array of circles in AutoCAD using c# -

ios - UITEXTFIELD InputView Uipicker not working in swift -

Python Pig Latin Translator -