Runtime

作者: Skang | 来源:发表于2015-10-26 16:41 被阅读69次

 

 获取加方法  :  class_getClassMethod   

Method  method1 = class_getClassMethod ( [Person class],@selector(run) );

 获取减方法   :  class_getInstanceMethod    

Method method2 = class_getInstanceMethod ( [Person class],@selector(sleep) );

交换方法 :  method_exchangeImplementations( 方法1,方法2 );

method_exchangeImplementations(method1, method2);

相关文章

网友评论

      本文标题:Runtime

      本文链接:https://www.haomeiwen.com/subject/mfdxhttx.html