真搞不清楚在iOS的多任务处理API,如beginBackgroundTaskWithExpirationHandler等如何在iOS应用程序中使用多任务处理?
对于录制视频时,当按下按钮开始记录的情况下,我们把
if ([[UIDevice currentDevice] isMultitaskingSupported]) {
[self setBackgroundRecordingID:[[UIApplication sharedApplication] beginBackgroundTaskWithExpirationHandler:^{}]];
}
录制结束
if ([[UIDevice currentDevice] isMultitaskingSupported]) {
[[UIApplication sharedApplication] endBackgroundTask:[self backgroundRecordingID]];
}
时
等谁可以解释这些是什么意思。 正如你所看到的,当开始录制时,beginBackgroundTaskWithExpirationHandler块是空白的(没什么可做的?),这些代码的用法是什么?
非常感谢解释。