[英]iphone_os_version_max_allowed >= 90000 returns false in Xcode 6.3.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 我正在使用Google驱动器sdk开发应用程序,在Xcode 5中可以正常工作,但是现在我在xcode6中打开它,并为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 in Xcode6.3.1
__IPHONE_OS_VERSION_MAX_ALLOWED
is __IPHONE_8_3
and it always make it false. 但问题出在
Xcode6.3.1
__IPHONE_OS_VERSION_MAX_ALLOWED
是__IPHONE_8_3
,并且始终使它为假。 I tested in my iphone5c with iOS9.2
but it always return False and got to the else part. 我在iOS9.2的
iOS9.2
进行了测试,但始终返回False并转到else部分。 please help me... 请帮我...
Thanks in advance 提前致谢
See here for a discussion on __IPHONE_OS_VERSION_MAX_ALLOWED 请参阅此处以获取有关__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. 基本上,正如您提到的,这是Xcode的问题,它是在编译时回答的,而不是针对您的设备的。 You should be instead doing a check one of the ways implemented here .
相反,您应该检查此处实现的方法之一。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.