@@ -13,10 +13,12 @@ * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #include "config.h" + +#include #import "OFNotImplementedException.h" #import "OFString.h" #import "common.h" @@ -29,14 +31,17 @@ selector: selector] autorelease]; } - initWithClass: (Class)class_ { - Class c = [self class]; - [self release]; - @throw [OFNotImplementedException exceptionWithClass: c - selector: _cmd]; + @try { + [self doesNotRecognizeSelector: _cmd]; + abort(); + } @catch (id e) { + [self release]; + @throw e; + } } - initWithClass: (Class)class_ selector: (SEL)selector_ { @@ -51,16 +56,16 @@ { if (description != nil) return description; description = [[OFString alloc] initWithFormat: - @"The method %s of class %@ is not or not fully implemented!", - sel_getName(selector), inClass]; + @"The selector %s is not understood by class %@ or not (fully) " + @"implemented!", sel_getName(selector), inClass]; return description; } - (SEL)selector { return selector; } @end