Listing Methods at Runtime in Objective C
Before getting into creating my next Rapid Weaver plugin, I needed to do some experimentation to make sure what I wanted to achieve was possible. Wanting to manipulate some aspects of RWPage objects, I first required a list of methods for the RWPage class.
Thanks to Matt Gallagher’s IMP of the current method entry, I was able to generate my method list with the following code:
#import "objc/objc-class.h" // Iterate over the class and all superclasses Class currentClass = [RWPage class]; while (currentClass) { // Iterate over all instance methods for this class unsigned int methodCount; Method *methodList = class_copyMethodList(currentClass, &methodCount); unsigned int i = 0; for (; i < 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); } |
Method list acquired, the process of whittling it down until I found the one I wanted began.


Listing Methods at Runtime in Objective C http://t.co/wTsMWuQe
I’ve been trying to contact you via your website’s contact form, but it generates an error message, even w/ all required fields filled.
I’ve purchased MetaMate and have been having some issues. If I open one project file that includes a MetaMate page, close it and try to open another project file, I get an error message telling me that “a page could not be opened because the required plugin cannot be found. etc… Required plugin MetaMate.” Or words to that effect. I cannot open two project files that both include MetaMate pages w/out restarting RapidWeaver in between.
Also, when I had one project file opened that included a MetaMate page, I wanted to open another project file that also included a MetaMate page. When I did this, all of the second project files pages were automagically added to the first project files MetaMate project files list. No way to delete them, I had to delete the MetaMate page and start over again. Clearly there are some bugs in the new plugin, and in your contact form.
Hi William,
Sorry for the issues you’ve been experiencing – I’ve contacted you via email.
Hi there! Sorry to contact you here but your contact form is broken and since the other gentleman did the same, I do not feel so bad.
I purchased metamate and I love the concept – however it is still buggy as hell despite the numerous updates.
I do have the same problem as the gentleman: opening two projects automatically populate a metamate page with the other pages of the other project – not very efficient.
There should be a button to clear only the page we are working on – would be very handy.
Other problem: even after publishing and republishing all files, the new metatargs do not appear anywhere on my site! I lost them all – yet they are in the metamate page. Perhaps I don’t understand how to operate it but it appears to defeat the purpose.
The help button in the page menu is buggy – information does not always show.
Thanks!
C.
Hi There,
Sorry that you’re having problems, thanks for letting me know!
Thought I fixed that darn contact form! I’ll have to get onto that right away.
I tried to find your email address in my records but couldn’t find it from your twitter account – could you please email me at mike [at] pagesofinterest.net?
It would be helpful to know the version of OS X, Rapid Weaver & Meta Mate you’re running, and any more information that you think might be helpful for me in my quest to squash the bugs.
Thanks
Mike