您的位置:首页 > 移动开发 > IOS开发

iOS 版本判定

2015-09-07 10:53 543 查看
double version = [[UIDevice
currentDevice].systemVersion
doubleValue];//判定系统版本。

    if(version>8.0f){

        [[UINavigationBar
appearance] setBackgroundImage:[UIImage
imageNamed: @"navigationBar.jpg"]
forBarMetrics:UIBarMetricsDefault];

       
NSURL *url = [NSURL
URLWithString:UIApplicationOpenSettingsURLString];

        [[UIApplication
sharedApplication] openURL:url];

    }else{

       
UIAlertView *alert = [[UIAlertView
alloc] initWithTitle:@"提示"
message:@"当前版本过低"
delegate:self
cancelButtonTitle:nil
otherButtonTitles:@"确定",
nil];

        [alert
show];

    }
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: