iphone - iOS 中的函数指针?

标签 iphone macos ios

谁能告诉我有关 iOS 中的函数指针的信息?谢谢:D

最佳答案

如果我正确理解你在想什么。

<强>1。就像在 C 中一样

void yourfunc() {}

foo(&yourfunc);

<强>2。在 Objective-C 中 您可以使用@selector 和method sig“引用”一个方法

- (void) test:(NSInteger)n withTest:(BOOL)isTrue {}

[object performSelector:@selector(test:withTest:)];

关于iphone - iOS 中的函数指针?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3581917/

相关文章:

ios - iPhone 如何使用 json 发布 nsarry

linux - 使用守护进程或更好的解决方案运行 .exe 以获得类似于 Windows 服务(mac 和 linux)的东西?

iphone - Interface Builder .xib 文件的内部结构是什么?

ios - 从新项目更新 iOS 应用程序

javascript - onClick 中的嵌套函数调用未触发

iPhone - 从 NSArray 对象获取唯一值

iphone - 在不减慢 xcode 的情况下在 iPhone 应用程序中包含许多图像

iphone - 将观察者添加到每个 View 或动态呈现 View

swift - 错误 - 带有 top 命令的 NSTask

ios - 应用程序启动时令人费解的崩溃