if ([[AVAudioSession sharedInstance] respondsToSelector:@selector(requestRecordPermission:)]) { [[AVAudioSession sharedInstance] requestRecordPermission:^(BOOL granted) { if (granted) { NSLog(@"允许使用麦克风!"); } else { NSLog(@"不允许使用麦克风!"); } }]; }