- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我正在使用仅在 iOS 10 中可用的 UserNotification
框架。我正在声明一个使用此框架的方法,到目前为止,我一直在检查可用性,如下所示:
@interface MyService : NSObject
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 100000
-(BOOL)handleWillPresentNotification:(UNNotificationContent *)notificationContent;
#endif
@end
XCode 9 beta 刚刚发布,使用这段代码我收到警告
'UNNotificationContent' is partial: introduced in iOS 10.0 Annotate 'handleWillPresentNotification:withCompletionHandler:' with an availability attribute to silence
问题是我如何在 Objective C 代码中注释整个方法?我知道 Xcode 9 引入了
if (@available(iOS 10, *)) {
// iOS 10 ObjC code
}
但是如何将整个方法(包括其签名)包装在其中?
干杯
最佳答案
回答我自己的问题:我需要使用 NS_AVAILABLE_IOS
宏标记方法,如下所示:
-(BOOL)handleWillPresentNotification:(UNNotificationContent *)notificationContent NS_AVAILABLE_IOS(10_0);
关于objective-c - 如何在 Xcode 9 中检查 API 可用性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45302614/
是否可以使用 JHipster 5(带有 Spring Boot 2)?我注意到在发行说明中提到了 JHipster 5 的工作,但看不到任何关于如何安装/运行 5 的“预览”版本的信息。 最佳答案
使用多个显示器时,有没有办法拆分 Xcode 界面? 我有 2 台显示器,但仍然没有找到一种简单的方法在超过 1 台显示器上使用它(左侧的 Storyboard,右侧的代码) - 就像在 Androi
我正在尝试处理 uwp 应用程序中的 xml,我添加了引用和用法: using System.Xml; using System.Xml.XPath; 但是 private XmlDocument d
JSunit 真的是 Junit 到 Javascript 的直接端口吗?所以我听说过,但我想知道为什么我的公司没有使用它。我的公司有很多聪明人,所以如果我们不使用它,我想知道 Jsunit 作为 j
当使用原始 TCP 套接字时,需要进行消息帧化,如 here 所述,带有长度前缀或分隔符。 我今天遇到了“SOCK_SEQPACKET”套接字选项,它显然可以几乎透明地进行消息框架。 目前“SOCK_
我在一个小型开发小组工作。我们正在构建和改进我们的产品。 半年前我们无法考虑更高的特性,比如可用性,因为我们的产品有很多问题。许多错误、高技术债务、低性能和其他问题使我们无法专注于可用性。 随着时间的
是否可以通过编程方式控制@RestController来启用或禁用它?我不想只在每个 @RequestMapping 方法中编写代码来执行某种 if (!enabled) { return 404Ex
azure 的 blob 在被新版本覆盖时是否可供下载? 根据我使用 Cloud Storage Studio 的测试,下载被阻止,直到覆盖完成,但是我的测试来自同一台计算机,因此我无法确定这是正确的
我一直认为(但出于某种原因从未实践过)动态生成且仅包含一个项目的下拉菜单应该自动选择该项目。这与我观察到的典型方法相反,即在顶部创建一个空白条目,您仍然必须与菜单交互以进行单个可用选择。 例如,当我登
我正在为我的兄弟编写一个基于 Web 的小实用程序,他需要合并 CSV 文件中的列。我知道这样的事情肯定存在于某个地方,但这很大程度上是因为这是一个有趣的小练习。 无论如何,我正在尝试找出最好/最简洁
如您所知,pinterest api 现在似乎已关闭。( api.pinterest.com )在此站点中:http://tijn.bo.lt/pinterest-api ,它表示只读访问仍然有效。到
我想为公寓可用性应用程序制作日历 View 。我的想法是从 MySQL 数据库获取日期范围(不可用日期)并将其显示在日历 View 中。我的日历 View 应该有 3 种不同的样式: 可用日期 不可用
我究竟应该如何配置我的广播接收器以使我的应用程序响应 wifi 可用性的变化。不过,当应用程序未运行时,我并不真正关心对此使用react。 我在这里试图完成的是,当应用程序运行时,我需要使本地数据库与
在我的网络应用程序中,我有 parent 和保姆。 保姆将声明工作时间(时间间隔),该工作时间将存储在工作时间表中。 家长也会每隔一段时间表达自己的需求(暂时不需要存储)。 所以我设计了这样的可用性表
概览 我希望在 CloudKit 无法访问时收到通知。 CloudKit 可能无法访问的可能场景: CloudKit 服务器不可访问 互联网连接不可用。 迄今为止所做的尝试: 观察 CKAccount
好的,我有我为核心数据创建的类 LoginPass.h 然后我有头等舱 FirstClass.h 然后我需要在 SecondClass 中使用这些类,我在其中使用 @class 声明它们。头文件 Se
例如 linux kernel-2.6.32-279 没有在/usr/include/asm-generic/socket.h 中定义 SO_REUSEPORT 但 kernel-2.6.32-431
我正在尝试安装的工具说: MySQL server data directory needs to reside on an LVM volume 如何检查我的数据目录是否在 LVM 上? 最佳答案
这个问题在这里已经有了答案: 关闭 11 年前。 Possible Duplicate: Programmatically find device support GPS or not? 如何检查设
我听说汽车行业有一种叫做 MISRA C 的东西。 其他高可靠性/可用性/安全性行业的相关标准是什么,例如 空间 飞机 银行/金融 汽车 医疗 国防/军事 ??? -亚当 最佳答案 查看戈达德太空飞行
我是一名优秀的程序员,十分优秀!