user403015
user403015

Reputation: 7227

What will happen if I use some iOS5 features but the deployment target is a iOS4 device?

I am switching my SDK from iOS4 to iOS5, and I want to use some iOS5 features in my old iOS4 projects.

What will happen if I use some iOS5 features but the deployment target is a iOS4 device ?

Thanks.

Upvotes: 1

Views: 270

Answers (2)

Nekto
Nekto

Reputation: 17877

That features will work only on devices with installed iOS5 or later.

If you will call new iOS5 API on devices with previous versions of iOS (4.x) it will crash in that places.

Upvotes: -1

Tomen
Tomen

Reputation: 4854

it will just crash, most propably because of unrecognized selector.

to avoid this, you can fork the code with if()-statements

like

if([object respondsToSelector:@newiOS5Selector])

Also, you can read out the current iOS version via UIDevice

+(BOOL)platformSupportsVersion:(NSString *)requiredVersion
{
    float systemVersion = [[[UIDevice currentDevice] systemVersion] floatValue];
    if (systemVersion >= [requiredVersion floatValue]) {
        return YES;
    } 

    return NO;
}

Upvotes: 2

Related Questions