【问题标题】:class_addMethod on iphone (objective-c)iphone上的class_addMethod(objective-c)
【发布时间】:2012-02-17 22:03:19
【问题描述】:

我正在尝试使用此处接受的答案:Dynamic UIMenuItems with @selector and dynamic methods 但它给出了一个警告(它不起作用):函数'class_addMethod'的隐式声明

我已经搜索了谷歌但不知道?

【问题讨论】:

    标签: iphone objective-c ios


    【解决方案1】:

    #include <objc/runtime.h> 添加到您的实现文件(.m 或 .c)的顶部。

    【讨论】:

    • 更好的是#include <objc/objc-runtime.h>
    • 它在/usr/include/objc/objc-runtime.h 下,runtime.h 也是如此
    猜你喜欢
    • 1970-01-01
    • 2012-02-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-04-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多