Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

cnstoll

macrumors 6502
Original poster
Aug 29, 2010
254
0
So I'm about done working on an app update that will track a user's location in the background. Everything works great, of course, on phones and OS's that have that capability.

For those that don't I have implemented some alternate functionality. But I need to check for whether or not I should switch to that.

Initially I used two checks to determine this. I checked the system version to see whether or not it was >= "4.0", and then I also checked if location services were available (example: if a user disabled location services, it would respect that).

I thought this would work until I remembered a specific detail: the iPhone 3G can run iOS 4...but doesn't support multitasking.

So basically I need a new way to check for that condition. I don't want to put a hardware requirement in the info.plist file, because the app will run just fun without that on the 3G. What i'd like to be able to do is just check for something like "canMultitask" if something like that exists. Thanks.
 
Nothing like that exists.

Are you certain that that there is a device running an OS >= 3.2 that can't multitask?
 
It exists.

UIDevice has a boolean property multitaskingSupported.
u don't need 2 check "if OS>=4.0..."
u'r check is:
UIDevice *currentDevice = [UIDevice currentDevice];
if ([currentDevice respondsToSelector:mad:selector(isMultitaskingSupported)]) {
// iOS >= 4.0 because the property multitaskingSupported exists
if ([currentDevice isMultitaskingSupported]) {
// Multitasking is supported!
}
}
 
Looks like my info is out of date. At any rate multitasking is also available on 3.2.

No it isn't, 4.2 was the first iPad OS to support multitasking, 4.0 was the first iPhone/iPod Touch OS to support it. 3.x does not have any multitasking support. And there are devices running iOS > 4.0 that can't multitask, the iPhone 3G, for example.
 
Yeah, iPhone 3G and iPod Touch 2nd Gen can not multitask. iPhone and iPod Touch 1st gen don't have 4.x so they are left out of multitasking as well.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.