如果在oc文件中直接使用class_addMethod方法会报这个错误,Declaration of 'class_addMethod' must be imported from module 'ObjectiveC.runtime' before it is required。
但是,发现并没有ObjectiveC.runtime这样的文件,所以无法import。
后来发现,#import <objc/runtime.h>,添加这行代码就能使用class_addMethod;
如果在oc文件中直接使用class_addMethod方法会报这个错误,Declaration of 'class_addMethod' must be imported from module 'ObjectiveC.runtime' before it is required。
但是,发现并没有ObjectiveC.runtime这样的文件,所以无法import。
后来发现,#import <objc/runtime.h>,添加这行代码就能使用class_addMethod;
本文标题:使用class_addMethod方法需要导入什么
本文链接:https://www.haomeiwen.com/subject/vwefvftx.html
网友评论