gpt4 book ai didi

ios - CFNotificationCenter 杂项回调的正确用法是什么?

转载 作者:行者123 更新时间:2023-11-28 13:13:07 25 4
gpt4 key购买 nike

截至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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com