object c

 #import <objc/objc-runtime.h> 

   const char *name = class_getName([NSObject class]);

   printf("%s\n", name);

void PrintObjectMethods() {

unsigned int count = 0;

Method *methods = class_copyMethodList([NSObject class],&count);

     for (unsigned int i = 0; i < count; ++i) {

       SEL sel = method_getName(methods[i]);

       const char *name = sel_getName(sel);

       printf("%s\n", name);

}

     free(methods);

}

posted @ 2014-06-06 16:26  anjsxz  阅读(148)  评论(0编辑  收藏  举报