How can I determine if multitasking is supported on a device?
Asked Answered
N

1

5

I updated to the latest iOS 4 SDK, and updated my iPod touch to the latest OS fine. I built my application against 4.0, and it appears to use the multitasking functionality fine. However, when I run my application on my iPod touch, it does not appear to use multitasking.

How can I detect whether multitasking is supported on a device in code? Is there any way to work around this for unsupported devices?

Notation answered 9/8, 2010 at 6:55 Comment(0)
T
12

You can check whether the device is capable of multitasking like this:

UIDevice* device = [UIDevice currentDevice];
BOOL backgroundSupported = NO;
if ([device respondsToSelector:@selector(isMultitaskingSupported)])
   backgroundSupported = device.multitaskingSupported;
Twaddle answered 9/8, 2010 at 16:18 Comment(9)
thank you sir but i didn't get you . whither it is going to be use in the codeNotation
You asked how to detect whether your device supports multitasking. The above code does exactly that. After running this piece of code, backgroundSupported will be YES if your device supports multitasking, otherwise NO.Twaddle
I understand but where it is going to be use in the application codeNotation
Whereever you want to know if multitasking is available and behave differently.Twaddle
I have a problem with the multitasking . I update the xcode & ipod to ios4 for multitasking Ok .But When I run my project it work and help multitasking automatically on simulator . But When I run project on iPod device the multitasking is not supporting .I want to implement this multitasking on my project .I want to run the third party app by double click the home button. I send the the link of multitasking in iphone please check it out this youtube.com/watch?v=7_Wz1nxOz6Q . I want to implement this thinks in my project.For this i need guide line.please help sir thank in advanceNotation
iPod does not support multitasking even if you've updated it to iOS4. Multitasking is only supported on iPhone 3GS and iPhone 4.Twaddle
I implement the code which you give me like this - (void)applicationDidEnterBackground:(UIApplication )application { UIDevice device = [UIDevice currentDevice]; BOOL backgroundSupported = NO; if ([device respondsToSelector:@selector(isMultitaskingSupported)]) backgroundSupported = device.multitaskingSupported; } but ipod doesn't work what i do now sirNotation
See my comment above. The iPod does not support multitasking regardless whether you've installed iOS 4 or not. You will have to get an iPhone 3GS or an iPhone 4 to get multitasking.Twaddle
@tob - Actually, the third-generation iPod touch also supports multitasking as well, but it sounds like he has an older model.Searles

© 2022 - 2024 — McMap. All rights reserved.