Index: src/OFIntrospection.h ================================================================== --- src/OFIntrospection.h +++ src/OFIntrospection.h @@ -25,17 +25,17 @@ */ @interface OFMethod: OFObject { SEL selector; OFString *name; - OFString *typeEncoding; + const char *typeEncoding; } #ifdef OF_HAVE_PROPERTIES @property (readonly) SEL selector; @property (readonly, copy) OFString *name; -@property (readonly, copy) OFString *typeEncoding; +@property (readonly) const char *typeEncoding; #endif /** * \brief Returns the selector of the method. * @@ -53,11 +53,11 @@ /** * \brief Returns the type encoding for the method. * * \return The type encoding for the method */ -- (OFString*)typeEncoding; +- (const char*)typeEncoding; @end /** * \brief A class for introspecting classes. */ Index: src/OFIntrospection.m ================================================================== --- src/OFIntrospection.m +++ src/OFIntrospection.m @@ -37,12 +37,11 @@ @try { selector = method_getName(method); name = [[OFString alloc] initWithCString: sel_getName(selector)]; - typeEncoding = [[OFString alloc] - initWithCString: method_getTypeEncoding(method)]; + typeEncoding = method_getTypeEncoding(method); } @catch (id e) { [self release]; @throw e; } @@ -55,12 +54,11 @@ @try { selector = method->method_name; name = [[OFString alloc] initWithCString: sel_get_name(selector)]; - typeEncoding = [[OFString alloc] - initWithCString: method->method_types]; + typeEncoding = method->method_types; } @catch (id e) { [self release]; @throw e; } @@ -69,11 +67,10 @@ #endif - (void)dealloc { [name release]; - [typeEncoding release]; [super dealloc]; } - (SEL)selector @@ -84,18 +81,18 @@ - (OFString*)name { OF_GETTER(name, YES) } -- (OFString*)typeEncoding +- (const char*)typeEncoding { - OF_GETTER(typeEncoding, YES) + return typeEncoding; } - (OFString*)description { - return [OFString stringWithFormat: @"", + return [OFString stringWithFormat: @"", name, typeEncoding]; } @end @implementation OFIntrospection