【发布时间】:2019-07-27 15:33:21
【问题描述】:
我写了以下代码:
@interface TestClass : NSObject
//
-(void)testLog;
//
+(void)testLog;
@end
//===============================
SEL sel = @selector(testLog);
IMP imp = class_getMethodImplementation([TestClass class], sel);
imp();
//===============================
SEL testSel = @selector(testLog);
IMP testImp = class_getMethodImplementation(objc_getMetaClass(class_getName([TestClass class])), testSel);
testImp();
我将Enable Strict Checking of objc_msgSend Calls设置为NO,但还是有这个错误。
为什么会出错?
【问题讨论】:
-
已解决,修改
objc_msgSend为YES,构建成功!
标签: objective-c runtime