作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
截至Apple Docs它的签名和详细信息如下:
CFNotificationCallback
在发布通知时为通知的每个观察者调用的回调函数。
声明
typealias CFNotificationCallback = CFunctionPointer<((CFNotificationCenter!, UnsafeMutablePointer<Void>, CFString!, UnsafePointer<Void>, CFDictionary!) -> Void)>
导入语句
import CoreFoundation
但我没能弄清楚如何从 swift 中使用它,这些指针对我来说似乎很奇怪。
最佳答案
您不能在 Swift 中创建 CFNotificationCallback。它是一个指向 C 函数的指针。您不能在 Swift 中创建 C 函数或指向 C 函数的指针。
关于ios - CFNotificationCenter 杂项回调的正确用法是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30493731/
本章处理一些实际问题. 语句定界符 有些语言需要一定类型的标点,一般会是分号(;)来结束程序的每一语句.Ruby却采用了shell里的sh和csh的方便做法.一行中的多个语句由分号分开,但在行尾
我是一名优秀的程序员,十分优秀!