ios - Loop through all 'instance' and 'class' methods of a subclass, at runtime -
this lists methods in nsobject. i'm struggling understand why doing because expecting methods of 'tutorialerrormanager' instead.
class currentclass = [tutorialerrormanager class]; while (currentclass) { // iterate on instance methods class unsigned int methodcount; method *methodlist = class_copymethodlist(currentclass, &methodcount); unsigned int = 0; (; < methodcount; i++) { nslog(@"%@ - %@", [nsstring stringwithcstring:class_getname(currentclass) encoding:nsutf8stringencoding], [nsstring stringwithcstring:sel_getname(method_getname(methodlist[i])) encoding:nsutf8stringencoding]); } free(methodlist); currentclass = class_getsuperclass(currentclass); }
Comments
Post a Comment