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. vue_music:排行榜rank中top-list.vue中样式的实现:class

    排行榜的歌曲列表,根据排名渲染不同的样式,同时需要考虑分辨率的2x 3x图 不同的样式--:class 考虑分辨率的2x 3x图--需要在stylu中的mixin中bgImage根据屏幕分辨率选择图片 ...

  2. Spring MVC-Hello World示例(转载实践)

    以下内容翻译自:https://www.tutorialspoint.com/springmvc/springmvc_hello_world_example.htm 说明:示例基于Spring MVC ...

  3. Codeforces 474 C. Captain Marmot

    4*4*4*4暴力+点的旋转+推断正方型 C. Captain Marmot time limit per test 1 second memory limit per test 256 megaby ...

  4. JavaThread等待/通知经典范式

    JavaThread等待/通知经典范式 package com.stono.thread; import java.text.SimpleDateFormat; import java.util.Da ...

  5. 在AIX下面查询上一次命令

    在AIX下面查询上一次命令 输入 r 或者 set -o vi 用vi的操作找上一次命令: 学习了: http://blog.itpub.net/66634/viewspace-1000843/ ht ...

  6. 一次获取多个oracle序列值

    一次获取多个oracle序列值 学习了:http://blog.csdn.net/wangchsh2008/article/details/53495961 select seq_one.nextva ...

  7. 《编程导论(Java)·2.1.2 啊,我看到了多态》-什么是多态(polymorphism)

    1.不明觉厉 很多人学习多态时,会认为. 之所以不明觉厉,由于多态的定义:事物存在的多种表现形态:而后,有人将重载(overload).改写(override).多态变量和泛型归结于同一个术语&quo ...

  8. leetcode || 50、Pow(x, n)

    problem: Implement pow(x, n). Hide Tags Math Binary Search 题意:求x的n次幂 thinking: (1)最简单想到的是直观上的数学幂函数求法 ...

  9. 【cl】在代码中查找系统页面中的代码方法

    页面链接http://192.168.2.51:8080/xxcb1/xxbs/action/handling!view.action?toId=402882ae4e7d1761014e877fb22 ...

  10. Java程序猿的JavaScript学习笔记(9—— jQuery工具方法)

    计划按例如以下顺序完毕这篇笔记: Java程序猿的JavaScript学习笔记(1--理念) Java程序猿的JavaScript学习笔记(2--属性复制和继承) Java程序猿的JavaScript ...