iOS之Runtime Api接口大全

iOS之Runtime Api接口大全,第1张

Runtime介绍

Objective-C 扩展了 C 语言,并加入了面向对象特性和 Smalltalk 式的消息传递机制。而这个扩展的核心是一个用 C 和 编译语言 写的 Runtime 库。它是 Objective-C 面向对象和动态机制的基石。

Objective-C 是一个动态语言,这意味着它不仅需要一个编译器,也需要一个运行时系统来动态得创建类和对象、进行消息传递和转发。理解 Objective-C 的 Runtime 机制可以帮我们更好的了解这个语言,适当的时候还能对语言进行扩展,从系统层面解决项目中的一些设计或技术问题。了解 Runtime ,要先了解它的核心 - 消息传递 (Messaging)。

Runtime其实有两个版本: “modern” 和 “legacy”。我们现在用的 Objective-C 2.0 采用的是现行 (Modern) 版的 Runtime 系统,只能运行在 iOSmacOS 10.5 之后的 64 位程序中。而 macOS 较老的32位程序仍采用 Objective-C 1 中的(早期)Legacy 版本的 Runtime 系统。这两个版本最大的区别在于当你更改一个类的实例变量的布局时,在早期版本中你需要重新编译它的子类,而现行版就不需要。

Runtime 基本是用 C汇编写的,可见苹果为了动态系统的高效而作出的努力。你可以在这里下到苹果维护的开源代码。苹果和GNU各自维护一个开源的 runtime 版本,这两个版本之间都在努力的保持一

平时的业务中主要是使用官方Api,解决我们框架性的需求。

高级编程语言想要成为可执行文件需要先编译为汇编语言再汇编为机器语言,机器语言也是计算机能够识别的唯一语言,但是OC并不能直接编译为汇编语言,而是要先转写为纯C语言再进行编译和汇编的 *** 作,从OCC语言的过渡就是由runtime来实现的。然而我们使用OC进行面向对象开发,而C语言更多的是面向过程开发,这就需要将面向对象的类转变为面向过程的结构体。具体累得结构可以参见上一篇 iOS类的本质探索_风雨「83」的博客-CSDN博客 ,本篇主要看一下常用的runtime接口。

Working with Classes( *** 作类) class_getName(获取类的名称)
//参数:类Class //返回:char
const char *className=class_getName([myclass class]);
    NSLog(@"lg_class_getName:%s",className);
 class_getSuperclass(获取父类)
//参数:类Class //返回:父类Class
    Class result = class_getSuperclass([myclass class]);
    NSLog(@"lg_class_getName:%@",result);
class_isMetaClass(判断类是否是元类)
  //参数:类Class //返回:BOOL类型
    BOOL isMetaClass = class_isMetaClass([myclass class]);
    NSLog(@"lg_class_isMetaClass:%d",isMetaClass);
class_getInstanceSize(获取 类的实例大小)
//参数:类Class
    //返回:类的实例大小
    size_t resultSize = class_getInstanceSize([myclass class]);
    NSLog(@"lg_class_getInstanceSize:%zu",resultSize);
class_getInstanceVariable(获取类中指定的实例变量的信息的数据结构的指针)
 //参数:类Class 实例变量的名称 //返回:Ivar指针
    const char *result1 = [@"_name" UTF8String];
    Ivar result2 = class_getInstanceVariable([myclass class], result1);
    NSLog(@"lg_class_getInstanceVariable:%p",result2);
class_getClassVariable(获取类中指定的类变量的信息的数据结构的指针)
 //参数:1.类Class 2.类变量名称 //返回:指定的类变量的信息的数据结构的指针
    Ivar ivar = class_getClassVariable(myclass, [@"isa" UTF8String]);
    NSLog(@"lg_class_getClassVariable:%p",ivar);
class_addIvar(向类添加新的实例变量)
 Class CreatClass0 = objc_allocateClassPair([NSObject class], "CreatClass0", 0);
    class_addIvar(CreatClass0, "_attribute0", sizeof(NSString *), log(sizeof(NSString *)), "i");
    Ivar ivar1 = class_getInstanceVariable(CreatClass0, "_attribute0");
    NSLog(@"class_addIvar:%@",[NSString stringWithUTF8String:ivar_getName(ivar1)]);

class_copyIvarList(获取类的实例变量列表)
 //入参:1、类Class 2、unsigned int类型
    //返回:Ivar 类型的指针数组
    unsigned int copyIvarListCount = 0;
    Ivar *ivars = class_copyIvarList([myclass class], ©IvarListCount);
    for (NSInteger i = 0; i< copyIvarListCount; i ++) {
        Ivar ivar = ivars[i];
        const char *name = ivar_getName(ivar);
        NSLog(@"lg_class_copyIvarList:%s",name);
    }
    free(ivars);//释放

class_getIvarLayout(获取类的布局描述) 
//class_getIvarLayout(获取类 的布局描述)
    //lei class
    //返回:返回值是指向 uint8_t 的指针
    const uint8_t *resultvar = class_getIvarLayout([myclass class]);
    NSLog(@"lg_class_getIvarLayout:%p",resultvar);

class_setIvarLayout(设置类的 实例变量的修饰符) 
 //
    uint8_t u = 1;
    const uint8_t *u8 = &u;
    //参数:1.类Class 2.const uint8_t *
    class_setIvarLayout([myclass class], u8);
    
class_getWeakIvarLayout(获取 类的weak修饰的实例变量)
 //参数:类Class //返回:返回值是指向 uint8_t 的指针
    const uint8_t *resultWeakIvar = class_getWeakIvarLayout([myclass class]);
    NSLog(@"lg_class_getIvarLayout:%p",resultWeakIvar);
class_setWeakIvarLayout(设置类的实例变量的修饰符为weak)
 uint8_t u1 = 1;
    const uint8_t *u8t = &u1;
    //参数:1.类Class 2.const uint8_t *
    class_setWeakIvarLayout([myclass class], u8t);
class_getProperty(获取指定的属性)
 //参数:1.类Class 2.属性名 //返回:属性objc_property_t
    objc_property_t resultProperty = class_getProperty([myclass class], [@"name" UTF8String]);
    NSLog(@"lg_class_getProperty:%p",resultProperty);

 class_copyPropertyList(获取整个属性列表)
 //参数:1.类Class 2.unsigned int类型
    //返回:属性列表
    unsigned int copyPropertyListCount = 0;
    objc_property_t *propertys = class_copyPropertyList([myclass class], ©PropertyListCount);
    for (NSInteger i = 0; i < copyPropertyListCount; i++)
    {
        objc_property_t property = propertys[i];
        const char *name = property_getName(property);
        NSLog(@"lg_class_copyPropertyList:%s",name);
    }
    free(propertys);//释放

 class_addMethod(给类添加方法)
 //参数:1.类Class 2.方法名 3.imp,函数实现 4.方法参数类型描述 //返回值:BOOL
    BOOL resultaddMethod = class_addMethod([myclass class], NSSelectorFromString(@"lgMethod"), [self methodForSelector:@selector(lg_method)], "@@:");
    NSLog(@"lg_addMethod:%d",resultaddMethod);
class_getInstanceMethod(获取类的实例方法)
 //参数:1.类Class 2.方法名SEL
    //返回:method结构体指针
    Method resultInstanceMethod = class_getInstanceMethod([myclass class],
    @selector(lg_method));
    NSLog(@"lg_class_getInstanceMethod:%p",resultInstanceMethod);
class_getClassMethod(获取类方法)
 //入参:1.类Class 2.方法名SEL //返回:method结构体指针
    Method resultclassMethod = class_getClassMethod([myclass class], @selector(lgClassMethod));
    NSLog(@"lg_class_getClassMethod:%p",resultclassMethod);
class_copyMethodList(获取整个类的实例方法)
//参数:1、类Class 2、unsigned int 类型
    //返回:整个类的实例方法
    unsigned int copycopyMethodListCount = 0;
    Method *methods = class_copyMethodList([myclass class], ©copyMethodListCount);
    for (NSInteger i = 0; i < copycopyMethodListCount; i++) {
        Method method = methods[i];
        SEL name = method_getName(method);
        NSLog(@"lg_class_copyMethodList:%@",NSStringFromSelector(name));
    }
    free(methods);//释放

class_replaceMethod(交换方法) 
 [self lg_method1];
    //参数:1.类Class 2.方法名SEL 3.方法的实现IMP 4.方法参数描述
    //返回:BOOL
    BOOL resultreplace = class_replaceMethod([self class], @selector(lg_method1), [self
    methodForSelector:@selector(lg_method2)], NULL);
    NSLog(@"lg_class_replaceMethod:%d",resultreplace);
    [self lg_method1];

class_getMethodImplementation(获取方法实现)
//参数:1.类Class 2.方法名SEL //返回:方法实现IMP
    IMP resultMethodImplementation = class_getMethodImplementation([self class], @selector(lg_method));
    resultMethodImplementation();

class_respondsToSelector(判断是否响应方法)
  //参数:1.类Class 2.方法名SEL //返回:BOOL
    BOOL respondsToSelector = class_respondsToSelector(self.class, @selector(viewDidLoad));
    NSLog(@"lg_class_respondsToSelector:%d",respondsToSelector);
class_addProtocol(向类添加协议)
 //参数:1.类Class 2.协议
    //返回:BOOL
    BOOL resultaddProtocol = class_addProtocol([myclass class],
    NSProtocolFromString(@"UITableViewDelegate"));
    NSLog(@"lg_class_addProtocol:%d",resultaddProtocol);
class_addProperty(为类添加属性)
objc_property_attribute_t ownership = { "C", "" }; // C = copy
    objc_property_attribute_t backingivar = { "V", "_attribute0" };
    objc_property_attribute_t attrs[] = { type, ownership, backingivar };
    //参数:1.类Class 2.属性数组 3.属性个数
    //返回值:BOOL
    BOOL suc0 = class_addProperty(self.class, "_attribute0", attrs, 3);
    SEL getter = NSSelectorFromString(@"attribute0");
    SEL setter = NSSelectorFromString(@"setAttribute0:");
    BOOL suc1 = class_addMethod(self.class, getter, (IMP)attribute0Getter, "@@:");
    BOOL suc2 = class_addMethod(self.class, setter, (IMP)attribute0Setter, "v@:@"); NSLog(@"lg_class_addProperty:class_addProperty = %d,class_addMethod_Getter =
    %d,class_addMethod_Setter = %d",suc0,suc1,suc2);
class_replaceProperty(替换类的属性)
   objc_property_attribute_t type = { "T", "@\"NSString\"" };
    objc_property_attribute_t ownership = { "C", "" }; // C = copy
    objc_property_attribute_t backingivar = { "V", "_attribute0" };
    objc_property_attribute_t attrs[] = { type, ownership, backingivar };
    //参数:1.类Class 2.属性名称 3.属性的相关属性 4.属性的相关属性的个数
    class_replaceProperty(self.class, [@"logic" UTF8String], attrs, 3);
class_conformsToProtocol(判断是否遵循某个协议)
//参数:1.类Class 2.协议 //返回:BOOL
    BOOL conformsToProtocol = class_conformsToProtocol([self class], NSProtocolFromString(@"UITableViewDelegate"));
    NSLog(@"lg_class_conformsToProtocol:%d",conformsToProtocol);
class_copyProtocolList(获取协议列表)
//入参:1、类Class 2、unsigned int 类型
    //返回:整个类的遵循的协议
    unsigned int copyProtocolListCount = 0;
    Protocol * __unsafe_unretained *protocals = class_copyProtocolList([myclass class], ©ProtocolListCount);
    for (NSInteger i = 0; i < copyProtocolListCount; i++) {
        Protocol * protocal = protocals[i];
        const char *name = protocol_getName(protocal);
        NSLog(@"lg_class_copyProtocolList:%s",name);
    }
    free(protocals);//释放
class_getVersion( 获取类的版本号)
 //参数:类Class //返回:版本号
    int resultVersion = class_getVersion([myclass class]);
    NSLog(@"lg_class_getVersion:%d",resultVersion);
Adding Classes(添加类)
objc_allocateClassPair(添加一 个新类)
 //参数:1.新添加类的父类 2.新类的名称 3.填0 //返回:新类
    Class resultallocateClassPair = objc_allocateClassPair([NSObject class], [@"NewClass" UTF8String], 0);
    NSLog(@"lg_objc_allocateClassPair:%p",resultallocateClassPair);
objc_disposeClassPair(销毁一个类)
//参数:类Class 
objc_disposeClassPair(result);
objc_registerClassPair(注册使用类)
Class result = objc_allocateClassPair([NSObject class], [@"NewClass" UTF8String], 0);
    //参数:类Class
    objc_registerClassPair(result);
Instantiating Classes(实例化类)
class_createInstance(类实例化)
 //参数:1.类Class 2.额外分配的字节数
    //返回:类的实例
    NSObject *result4 = class_createInstance([NSObject
    class], 0);
    NSLog(@"lg_class_createInstance:%@",result4);
Working with Libraries(使用 库)
objc_copyImageNames(获取所 有objc的框架和动态库)
 unsigned int a = 0;
    //参数:unsigned int * //返回:C字符串数组
    const char **result5 = objc_copyImageNames(&a);
    for (int i = 0; i < a; i ++) {
        const char *c = result5[i];
        NSLog(@"lg_objc_copyImageNames:%@\n\n",[NSString stringWithUTF8String:c]);
        
    }

 class_getImageName(获取类源自的动态库的名称)
 //参数:类Class //返回:源自的动态库的名称
    const char *result6 = class_getImageName([myclass class]);
    NSLog(@"lg_class_getImageName:%@",[NSString stringWithUTF8String:result6]);
objc_copyClassNamesForImage(获取指定库或框架中的所有类 的名称)
unsigned int outCount = 0;
    Dl_info info;
    dladdr(&_mh_execute_header, &info);
    //参数:1.库或者框架 2.unsigned int * //返回:指定库或框架中的所有类的名称
    const char **result7 = objc_copyClassNamesForImage(info.dli_fname, &outCount);
    for (int i = 0; i < outCount; i ++) {
        const char *c = result7[i];
        NSLog(@"lg_objc_copyClassNamesForImage:%@",[NSString stringWithUTF8String:c]);
    }
Working with Selectors(使用选 择器)
sel_getName(获取方法的名称)
 
    SEL sel = NSSelectorFromString(@"lg_method");
    //参数:SEL //返回:方法的名称
    const char *result7 = sel_getName(sel);
    NSLog(@"lg_sel_getName:%@",[NSString stringWithUTF8String:result7]);
sel_registerName(注册方法)
//参数:const char * //返回:SEL
SEL result = sel_registerName([@"lglglg" UTF8String]); 

NSLog(@"lg_sel_registerName:%p",result);
sel_isEqual(判断俩个选择器是否相等)
 SEL sel1 = NSSelectorFromString(@"lg_method1");
    SEL sel2 = NSSelectorFromString(@"lg_method2");
    //参数:SEL //返回:BOOL
    BOOL result8 = sel_isEqual(sel1, sel2);
    NSLog(@"lg_sel_isEqual:%d",result8);
    
Working with Protocols(使用协 议)
objc_getProtocol(获取指定的协议)
  //参数:协议名称 //返回:协议
    Protocol *result9 = objc_getProtocol([@"UITableViewDelegate" UTF8String]);
    NSLog(@"lg_objc_getProtocol:%@",result9);
objc_copyProtocolList(获取所 有的协议列表)
 unsigned int count = 0;
    //参数:unsigned int * //返回:所有的协议列表
    Protocol __unsafe_unretained **result10 = objc_copyProtocolList(&count);
    for (int i = 0; i < count; i ++) {
        Protocol *pro = result10[i];
        NSLog(@"lg_objc_copyProtocolList:%@",pro);
    }
objc_allocateProtocol(创建协议)
//参数:协议的名称
//返回:协议
Protocol *result = objc_allocateProtocol([@"LGProtocol"
UTF8String]);
NSLog(@"lg_objc_allocateProtocol:%@",result);

。。。

Working with Instances(使用实例)
object_getIvar(获取对象中实例 变量的值)
 Ivar ivarVariable = class_getInstanceVariable([self class],[@"_name" UTF8String]); //参数:1.对象obj 2.实例变量ivar
    //返回:id
    NSString *result12 = object_getIvar(self, ivarVariable);
    NSLog(@"lg_object_getIvar:%@",result12);
object_setIvar(设置对象中实例 变量的值)
 Ivar ivarInstanceVariable = class_getInstanceVariable(self.class, [@"_name" UTF8String]);
    //参数:1.对象obj 2.实例变量ivar 3.实例变量的值id
    object_setIvar(self, ivarInstanceVariable, @"123456");

 object_getClassName(获取对象的类名)
 //参数:对象obj //返回:对象的类名
    const char*resultClassName = object_getClassName(self);
    NSLog(@"lg_object_getClassName:%@",[NSString stringWithUTF8String:resultClassName]);
object_getClass(获取对象的类 对象)
//参数:对象obj //返回:类Class
    Class resultgetClass = object_getClass(self);
    NSLog(@"lg_object_getClass:%@",resultgetClass);
object_setClass(设置对象的 类)
//参数:1.对象obj 2.类Class //返回:类Class
    Class resultsetClass = object_setClass(self, [myclass class]);
    NSLog(@"lg_object_setClass:%@",resultsetClass);
Obtaining Class Definitions(获 取类定义)
objc_getClassList(获取已注册 的类的数量)
//参数:1.传NUll获取当前注册的所有类 2.传0 //返回:所有注册类的总数
    int resultClassList = objc_getClassList(NULL, 0);
    NSLog(@"lg_objc_getClassList:%d",resultClassList);
objc_copyClassList(获取所有 已注册的类)
 unsigned int outCount; //参数:整数指针
    //返回:已注册的类的指针列表
    Class *resultcopyClassList = objc_copyClassList(&outCount);
    for (int i = 0; i < outCount; i++) {
        NSLog(@"lg_objc_copyClassList:%s",class_getName(resultcopyClassList[i]));
        
    }
    free(resultcopyClassList);

objc_lookUpClass(获取指定的类定义) 
//参数:类的名称 //返回:类Class
    Class resultlookUpClass = objc_lookUpClass([@"FitstViewController" UTF8String]);
    NSLog(@"lg_objc_lookUpClass:%@",resultlookUpClass);
objc_getClass(获取指定的类定 义)
//参数:类的名称
    //返回:类Class
    Class resultgetClass1 = objc_getClass([@"FitstViewController"
    UTF8String]);
    NSLog(@"objc_getClass:%@",resultgetClass1);
objc_getRequiredClass(获取指 定的类定义)
  //参数:类的名称 //返回:类Class
    Class resultRequiredClass = objc_getRequiredClass([@"FitstViewController" UTF8String]);
    NSLog(@"lg_objc_getRequiredClass:%@",resultRequiredClass);
objc_getMetaClass(获取指定 的类的元类定义)
//参数:类的名称
    //返回:类 Class
    id resultMetaClass = objc_getMetaClass([@"FitstViewController" UTF8String]);
    NSLog(@"objc_getMetaClass:%@",resultMetaClass);
Working with Instance Variables(使用实例变量)
ivar_getName(获取实例变量名称)
 Ivar ivarIV = class_getInstanceVariable([myclass class], [@"_name" UTF8String]);
    //参数:Ivar //返回:实例变量的名称
    const char *resultName = ivar_getName(ivarIV);
    NSLog(@"lg_ivar_getName:%@",[NSString stringWithUTF8String:resultName]);
ivar_getTypeEncoding(获取实 例变量的类型)
 Ivar ivar2 = class_getInstanceVariable(self.class, [@"_name" UTF8String]);
    //参数:Ivar
    //返回:实例变量的类型
    const char *resultypeEncoding = ivar_getTypeEncoding(ivar2);
    NSLog(@"lg_ivar_getTypeEncoding:%@",[NSString
    stringWithUTF8String:resultypeEncoding]);
ivar_getOffset(获取实例变量的偏移量)
 Ivar ivar3 = class_getInstanceVariable(self.class, [@"_name" UTF8String]); //参数:Ivar
    //返回:实例变量的类型
    ptrdiff_t resultOffset = ivar_getOffset(ivar3);
    NSLog(@"lg_ivar_getOffset:%td",resultOffset);
Associative References(关联引用)
objc_setAssociatedObject(设 置关联)
 /** policy:关联策略。有五种关联策略。
    OBJC_ASSOCIATION_ASSIGN 等价于 @property(assign)。 OBJC_ASSOCIATION_RETAIN_NONATOMIC等价于 @property(strong, nonatomic)。 OBJC_ASSOCIATION_COPY_NONATOMIC等价于@property(copy, nonatomic)。 OBJC_ASSOCIATION_RETAIN等价于@property(strong,atomic)。 OBJC_ASSOCIATION_COPY等价于@property(copy, atomic)。
    */
    //参数:1.要关联的对象 2.全局唯一KEY 3.关联的obj 4.关联策略policy
    objc_setAssociatedObject(self, [@"LGKey" UTF8String], @"123456",
    OBJC_ASSOCIATION_COPY_NONATOMIC);
    
objc_getAssociatedObject(获 取关联的值)
//参数:1.关联的对象 2.key
    //返回:关联的值
    id result = objc_getAssociatedObject(self, [@"LGKey"
    UTF8String]);
    NSLog(@"lg_objc_getAssociatedObject:%@",result);
objc_removeAssociatedObjects(删除关联)
//参数:关联的对象 
objc_removeAssociatedObjects(self);
Sending Messages(发送消息)
objc_msgSend:向类的实例发送带有简单返回值的消息 objc_msgSend_fpret:将带有浮点返回值的消息发送到类的实例 objc_msgSend_stret: 将带有数据结构返回值的消息发送到类的实例 objc_msgSendSuper:将带有简单返回值的消息发送到类实例的超类 objc_msgSendSuper_stret:将带有数据结构返回值的消息发送到类实例的超类 Working with Properties(使用属性)
property_getName(获取属性的名称)
 objc_property_t t = class_getProperty(self.class, [@"name" UTF8String]); //参数:objc_property_t
    //返回:属性的名称
    const char *result = property_getName(t);
    NSLog(@"lg_property_getName:%@",[NSString stringWithUTF8String:result]);
property_getAttributes(获取属 性的属性)
 objc_property_t t = class_getProperty(self.class, [@"name" UTF8String]);
    //参数:objc_property_t //返回:属性的属性
    const char *result = property_getAttributes(t);
    NSLog(@"lg_property_getAttributes:%@",[NSString stringWithUTF8String:result]);
property_copyAttributeValue(获取属性的指定属性的值)
 //参数:1.objc_property_t 2.属性的属性
    objc_property_t t = class_getProperty(self.class, [@"name" UTF8String]);
    //返回:属性的属性的值
    char *result = property_copyAttributeValue(t, [@"T" UTF8String]);
    NSLog(@"lg_property_copyAttributeValue:%@",[NSString stringWithUTF8String:result]);
property_copyAttributeList(获 取属性的属性列表)
 objc_property_t t = class_getProperty([myclass class], [@"name" UTF8String]);
    unsigned int count = 0;
    //参数:1.objc_property_t 2.unsigned int * //返回:属性的属性列表
    objc_property_attribute_t *result = property_copyAttributeList(t, &count);
    for (int i = 0; i < count; i ++) {
        objc_property_attribute_t t = result[i];
        NSLog(@"lg_property_copyAttributeList:%@",[NSString stringWithUTF8String:t.name]);
        
    }

Using Objective-C Language Features(使用OC语言特性) 
objc_enumerationMutation(检测到突变时,编译器将插入次函数 并且调用
/参数:id 
objc_enumerationMutation(self);
objc_setEnumerationMutationHandler(设置突变处理函数)
//参数:函数指针 
objc_setEnumerationMutationHandler(enumerationMutationHandler);
Working with Methods(使用方法)
method_invoke:方法调用

method_invoke_stret:调用返回值为结构体的方法 method_getName(获取方法的名称)
 Method method = class_getInstanceMethod(self.class, @selector(lg_method));
    //参数:Mothod //返回:SEL指针
    SEL result = method_getName(method);
    NSLog(@"lg_method_getName:%p",result);
method_getImplementation(获 取方法的实现)
 Method method = class_getInstanceMethod(self.class, @selector(lg_method));
    //参数:Mothod //返回:IMP指针
    IMP result = method_getImplementation(method);
    NSLog(@"lg_method_getImplementation:%p",result);

method_getTypeEncoding(获 取描述方法的参数和返回值类型 的字符串)

  Method method = class_getInstanceMethod(self.class, @selector(lg_method));
    //参数:Method //返回:描述方法的参数和返回值类型的字符串
    const char *result = method_getTypeEncoding(method);
    NSLog(@"lg_method_getTypeEncoding:%@",[NSString stringWithUTF8String:result]);
method_copyReturnType(获取 方法的返回值类型)
 Method method = class_getInstanceMethod(self.class, @selector(lg_method));
    //参数:Method //返回:方法的返回值类型
    char *result = method_copyReturnType(method);
    NSLog(@"lg_method_copyReturnType:%@",[NSString stringWithUTF8String:result]);

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/langs/734529.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-04-27
下一篇 2022-04-27

发表评论

登录后才能评论

评论列表(0条)

保存