Checks whether multiple tasks are supported in iOS.

Source: Internet
Author: User

-(BOOL) application :( UIApplication *) application didfinishlaunchingwitexceptions :( NSDictionary *) launchOptions {

// Override point for customization after application launch.

RootViewController * rootController = [[RootViewControlleralloc] init];

RootController. title = @ "Root ";

NavController = [[UINavigationControlleralloc] initWithRootViewController: rootController];


[RootController release];

[Self. windowaddSubview: navController. view];

[Self. windowmakeKeyAndVisible];

// Check whether multiple tasks are supported.

UIDevice * device = [UIDevicecurrentDevice];

BOOL backgroundSupported = NO;

If ([devicerespondsToSelector: @ selector (isMultitaskingSupported)]) {

BackgroundSupported = device. multitaskingSupported;

NSLog (@ "background supported: % d", backgroundSupported );

}

Return YES;

}

If yes, 1 is printed; otherwise, 0 is printed.

In versions earlier than iOS4, the operating system does not support multitasking. Therefore, once an application leaves the foreground, it is terminated.

IOS4 and later versions support multitasking, but some devices that run the iOS4 version but do not support multitasking. A system that supports multiple tasks. When an application leaves the foreground, it will temporarily switch to the inactive status and then to the background status. If the event is not processed in the background, it will be suspended shortly after, that is, it will enter the suincluded state.

The reason for not exiting is to facilitate the next time you start the application quickly.

The reason for suspension is to reduce power consumption.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.