这是我的代码:
-(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
}
}];
}
问题是,当我第一次运行我的应用程序时,在隐私中重置并且我的应用程序调用上述定义的方法后,它会产生麻烦。
当我的应用程序第一次运行时,弹出允许/禁止麦克风messgae(操作系统定义)方法。当我单击允许时,它显示布尔值(授予正确性)。正确进入 IF 内部。正确开始录制。但用户界面冻结。和 IF 的第二部分,即更改标签名称,直到执行一个计时器(我添加的停止方法和记录)才执行。
请帮忙。我可以感觉到我的 IF 的第二部分(更改 UI 标签不在前台工作),即后台工作正常工作。请帮忙,我不是专家。2 个月前开始 iOS 编程。