iphone_os_version_max_allowed >= 90000 returns false in Xcode 6.3.1

1.9k Views Asked by At

I am developing an application using Google drive sdk, in Xcode 5 its working fine, but now I open it in xcode6 and write this code for Safariviewcontroller

NSURL *URL = [NSURL URLWithString:@"https://accounts.google.com/SignUp"];
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 90000
if (URL) {

    if ([SFSafariViewController class] != nil) {
        SFSafariViewController *sfvc = [[SFSafariViewController alloc] initWithURL:URL];
        sfvc.delegate = self;
        [self presentViewController:sfvc animated:YES completion:nil];
    } else {
        if (![[UIApplication sharedApplication] openURL:URL]) {
            NSLog(@"%@%@",@"Failed to open url:",[URL description]);
        }
    }
}
#else
 [[UIApplication sharedApplication] openURL:URL];
#endif

but problem is inXcode6.3.1 __IPHONE_OS_VERSION_MAX_ALLOWED is __IPHONE_8_3 and it always make it false. I tested in my iphone5c with iOS9.2 but it always return False and got to the else part. please help me...

Thanks in advance

1

There are 1 best solutions below

0
On

See here for a discussion on __IPHONE_OS_VERSION_MAX_ALLOWED

Basically, as you mentioned, this is a question for Xcode, which is answered by it at compile time, not for your device. You should be instead doing a check one of the ways implemented here.