diff --git a/SocketIO.m b/SocketIO.m index 61ff67a..d7977c3 100755 --- a/SocketIO.m +++ b/SocketIO.m @@ -81,11 +81,12 @@ @implementation SocketIO heartbeatTimeout = _heartbeatTimeout, returnAllDataFromAck = _returnAllDataFromAck; -- (id) initWithDelegate:(id)delegate + +- (id) init { self = [super init]; if (self) { - _delegate = delegate; + _delegate = nil; _queue = [[NSMutableArray alloc] init]; _ackCount = 0; _acks = [[NSMutableDictionary alloc] init]; @@ -94,6 +95,15 @@ - (id) initWithDelegate:(id)delegate return self; } +- (id) initWithDelegate:(id)delegate +{ + self = [super init]; + if (self) { + _delegate = delegate; + } + return self; +} + - (void) connectToHost:(NSString *)host onPort:(NSInteger)port { [self connectToHost:host onPort:port withParams:nil withNamespace:@"" withConnectionTimeout:defaultConnectionTimeout];