/* * ----------------------------------------------------------------------------- * "THE BEER-WARE LICENSE" (Revision 42): * wrote this file. As long as you retain this notice you can * do whatever you want with this stuff. If we meet some day, and you think this * stuff is worth it, you can buy me a beer in return. Jakob Stoklund Olesen * ----------------------------------------------------------------------------- */ #import "Protocol-YASignature.h" // This private NSMethodSignature method is the only way of creating // signatures directly. @interface NSMethodSignature (YASignature) +signatureWithObjCTypes:(const char*)types; @end @implementation Protocol(YASignature) - (NSMethodSignature*)instanceMethodSignatureForSelector:(SEL)selector { struct objc_method_description *m = [self descriptionForInstanceMethod:selector]; if (!m) return nil; return [NSMethodSignature signatureWithObjCTypes:m->types]; } @end