ios-multitasking-检测当前系统是否支持多任务处理

调用UIDevice的实例方法isMultitaskingSupported,如下:

- (BOOL)isMultitaskingSupported
{
    BOOL result = NO;
    if ([[UIDevice currentDevice] respondsToSelector:@selector(isMultitaskingSupported)]) {
        result = [[UIDevice currentDevice] isMultitaskingSupported];
    }
    return result;
}

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    if ([self isMultitaskingSupported]) {
        NSLog(@"Multitasking is supported.");
    } else {
        NSLog(@"Multitasking is not supported.");
    }
    
    return YES;
}

运行结果: 2012-09-22 14:38:03.137 test[2134:f803] Multitasking is supported.

你可能感兴趣的:(ios,iPhone,Multitasking)