读书人

防止ios6上中文输入时锁屏lock scre

发布时间: 2014-07-07 16:13:38 作者: rapoo

防止ios6下中文输入时,锁屏lock screen导致crash

- (void)applicationDidEnterBackground:(UIApplication *)application{        if (kCFCoreFoundationVersionNumber > kCFCoreFoundationVersionNumber_iOS_5_1)    {        // Acquired additional time        UIDevice *device = [UIDevice currentDevice];        BOOL backgroundSupported = NO;        if ([device respondsToSelector:@selector(isMultitaskingSupported)]) {            backgroundSupported = device.multitaskingSupported;        }                if (backgroundSupported) {            __block UIBackgroundTaskIdentifier backgroundTask = [application beginBackgroundTaskWithExpirationHandler:^{                [application endBackgroundTask:backgroundTask];                backgroundTask = UIBackgroundTaskInvalid;            }];        }            }}

读书人网 >操作系统

热点推荐