@@ -23,18 +23,16 @@ #import "OFTCPSocket.h" #import "common.h" @implementation OFNotConnectedException -+ (instancetype)exceptionWithClass: (Class)class - socket: (OFStreamSocket*)socket ++ (instancetype)exceptionWithSocket: (OFStreamSocket*)socket { - return [[[self alloc] initWithClass: class - socket: socket] autorelease]; + return [[[self alloc] initWithSocket: socket] autorelease]; } -- initWithClass: (Class)class +- init { @try { [self doesNotRecognizeSelector: _cmd]; } @catch (id e) { [self release]; @@ -42,14 +40,13 @@ } abort(); } -- initWithClass: (Class)class - socket: (OFStreamSocket*)socket +- initWithSocket: (OFStreamSocket*)socket { - self = [super initWithClass: class]; + self = [super init]; _socket = [socket retain]; return self; } @@ -62,13 +59,14 @@ } - (OFString*)description { return [OFString stringWithFormat: - @"The socket of type %@ is not connected or bound!", _inClass]; + @"The socket of type %@ is not connected or bound!", + [_socket class]]; } - (OFStreamSocket*)socket { OF_GETTER(_socket, false) } @end