AVAudioSession sharedInstance requestRecordPermission: ^ (provided by BOOL)

Here is my code:

-(void) recordButton{

    [[AVAudioSession sharedInstance] requestRecordPermission:^(BOOL granted) {
    NSLog(@"value of the grant is :: %hhd", granted);
    if (granted)
    {
          // perform operation recording
          // perfrom some operation on UI(changing labels and all)
    }
    else
    {
      // do operation
    }

   }];

}

The problem is that when I launch my application for the first time, after reset in privacy, and my application calls the method described above, this creates problems.

At the first launch of the My Application application, enable / disable the use of messgae microphones (OS defined). when I click the allow button, it displays a boolean value (provided matching). Correctly goes inside the inverter. Starts recording correctly. but the user interface freezes. and the second part of IF ie changes the names of the shortcuts, does not execute until the timer is executed (the one added by me stops the method and recording).

PLease. , IF ( UI ), .. . , , . iOS 2 .

+4
2

. , If (), , ( ).

, . ( ).
( ) .

So UI , . .

+9

AVAudioSession requestRecordPermission - . (, , ).

method , granted. performSelectorOnMainThread: - , ( : ).

+2

All Articles