1

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

rmaddy
  • 314,917
  • 42
  • 532
  • 579
SAMIR RATHOD
  • 3,512
  • 1
  • 20
  • 45

1 Answers1

1

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.

Community
  • 1
  • 1
sschale
  • 5,168
  • 3
  • 29
  • 36