if ([[UIDevice currentDevice].systemVersion floatValue] >= 10.0) 运行环境判断;

#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0 编译器、开发环境支持;

部署环境支持;

UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter]

在低于库版本的运行环境运行时,center返回值为nil;

结论:

1)在对象或类符号不存在时,动态库没有任何存在,返回值为nil;

2)当一个类的接口存在跨系统级别的函数存在时,因为类或对象存在,函数符号不存在,所以存在崩溃的情况。

- (void)registerRemoteNotification {

if ([[UIDevice currentDevice].systemVersion floatValue] >= 10.0) {

#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0 // Xcode 8编译会调用

UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter];

center.delegate = self;

[center requestAuthorizationWithOptions:(UNAuthorizationOptionBadge | UNAuthorizationOptionSound | UNAuthorizationOptionAlert | UNAuthorizationOptionCarPlay) completionHandler:^(BOOL granted, NSError *_Nullable error) {

if (!error) {

NSLog(@"request authorization succeeded!");

}

}];

[[UIApplication sharedApplication] registerForRemoteNotifications];

#endif

} else if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0) {

UIUserNotificationType types = (UIUserNotificationTypeAlert | UIUserNotificationTypeSound | UIUserNotificationTypeBadge);

UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:types categories:nil];

[[UIApplication sharedApplication] registerUserNotificationSettings:settings];

[[UIApplication sharedApplication] registerForRemoteNotifications];

} else {

UIRemoteNotificationType apn_type = (UIRemoteNotificationType)(UIRemoteNotificationTypeAlert |

UIRemoteNotificationTypeSound |

UIRemoteNotificationTypeBadge);

[[UIApplication sharedApplication] registerForRemoteNotificationTypes:apn_type];

}

}

ios 编译版本 最低版本 运行版本 动态链接库的更多相关文章

  1. 如何把SQLServer数据库从高版本降级到低版本

    如何把SQLServer数据库从高版本降级到低版本 编写人:CC阿爸 2015-4-7 近期在给一个客户推行ECM系统时,基本客户的硬件环境,我们为其安装的为SQL2008 64位的数据库系统.在安装 ...

  2. 让C/C++程序一次编译可以发布到多版本Linux之上

    最近页游开放平台比较多, 每个平台要求的Linux版本各不相同, 这给开发人员部署服务器带来了很大的困难. 在本机Linux编译的程序,发布时即便将依赖的so附带到目标Linux环境,仍然会碰到依赖及 ...

  3. PHP集成环境自定义设置PHP版本,同时运行多个php版本,700个PHP版本随时切换,一键开启常用模块。

    本文采用我自己开发的纯绿色版WAMP环境(我将这个WAMP环境命名为PHPWAMP) (PHPWAMP默认集成VC,不需要单独安装) 那么什么是WAMP环境?WAMP这个词是什么意思? Windows ...

  4. CISCO运维记录之3650堆叠设备升级IOS(Version 16.3.6版本存在bug)

    CISCO运维记录之3650堆叠设备升级IOS(Version 16.3.6版本存在bug) 思科3000系列交换机使用cat3k_caa-universalk9.16.3.6版本存在bug,设备运行 ...

  5. 代码编译时JDK版本和运行时JDK版本不一致启动项目报错

    java编译: java编译就是.java文件变成.class文件的过程,这个过程一般在我们常用的编译器中进行,例如Ecliplse和IDEA等:下面以IDEA举例: 执行上述编译使用的JDK版本就是 ...

  6. Fastlane- app自动编译、打包多个版本、上传到app store

    Fastlane是一套使用Ruby写的自动化工具集,用于iOS和Android的自动化打包.发布等工作,可以节省大量的时间. Github:https://github.com/fastlane/fa ...

  7. 如何利用预编译指令来判断Delphi 的版本转载

    条件符号 含义 VERxx 编译器版本,XX表示版本,例如:Delphi 1.0 的编译器版本为80.Delphi 5.0 的编译器版本为130WIN32 是否WIN32的运行环境(Windows 9 ...

  8. cmake编译opencv时指定cuda版本

    之前有网友提问说,基于cmake编译时如果切换cuda版本,比如我同时装了cuda8和cuda9,opencv总是找到cuda9,我想用cuda8怎么办?实际上,手头上要配置的工程是基于opencv3 ...

  9. HCNA调整RIP的运行版本

    1.拓扑图 2.实验配置 R1配置RIPv1 md5加密认证 Please press enter to start cmd line! ############################### ...

  10. VS2010编译OpenSSL(两个版本)

    第一个版本: 编译工具 VS2010 OpenSSL版本 openssl-1.0.0a 下载 OpenSSL http://www.openssl.org/ 下载 from http://www.ac ...

随机推荐

  1. CentOS 7 x64下Apache+MySQL(Mariadb)+PHP5.6的安装

    每次搭建新服务器,都要来来回回把这些包再装一下,来来回回搞了不下20遍了吧,原来都是凭经验,配置过程中重复入坑是难免的,故写此文做个备忘.虽然有像xampp这样的集成包,但是在生产环境的Linux发行 ...

  2. VirtualBox虚拟机下 解决centos系统无法上网的问题

    首先,在VirtualBox中设置网卡连接方式:点“设置”,在弹出的界面中点“网络”,最后选择“连接方式”为“桥接网卡”或者网都可以络地址转换  这两种我试了试都可以 接下来修改一个文件就行: 1.打 ...

  3. CodeForces - 340 C - Tourist Problem

    先上题目: A - Tourist Problem Time Limit:1000MS     Memory Limit:262144KB     64bit IO Format:%I64d & ...

  4. 0808关于RDS如何恢复到本地教程

    转自http://www.cnblogs.com/ilanni/archive/2016/02/25/5218129.html 公司目前使用的数据库是阿里云的RDS,目前RDS的版本为mysql5.6 ...

  5. [Javascript] Understand common misconceptions about ES6's const keyword

    Values assigned with let and const are seen everywhere in JavaScript. It's become common to hear the ...

  6. 卷积神经网络(CNN)基础介绍

    本文是对卷积神经网络的基础进行介绍,主要内容包含卷积神经网络概念.卷积神经网络结构.卷积神经网络求解.卷积神经网络LeNet-5结构分析.卷积神经网络注意事项. 一.卷积神经网络概念 上世纪60年代. ...

  7. MongoDB 索引的使用, 管理 和优化

    MongoDB 索引的使用, 管理 和优化 2014-03-25 17:12 6479人阅读 评论(0) 收藏 举报  分类: MongoDB(9)  [使用explain和hint] 前面讲高级查询 ...

  8. LLVM每日谈之十九 LLVM的第一本系统的书<Getting Started with LLVM Core Libraries>

    作者:史宁宁(snsn1984) LLVM最终有了一本系统的书了--<Getting Started with LLVM Core Libraries>. 这本书号称是LLVM的第一本书, ...

  9. ProjectRuler 算法练习之 位数组成字符串同样的整数

    Problem :It can be seen that the number, 125874, and its double, 251748, contain exactly the same di ...

  10. vs2013+ffmpeg开发环境搭建【转】

    本文转载自:http://blog.csdn.net/spaceyqy/article/details/43115391 每当看到配环境,我就泪流满面,好吧,闲话不多说,进入正题. 1.去官方下载ff ...