From fe279daf268a2a3745e8a1fd76aa5b669b8419be Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 5 May 2014 01:30:35 -0400 Subject: [PATCH 1/2] When using init without setting the id delegate on initialization The result is: _queue = nil _acks = nil Which cause problems with acknowledgements. Which implies that inorder to use the library you must initialize with a delegate. Issue #176 --- SocketIO.m | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/SocketIO.m b/SocketIO.m index 61ff67a..b5de39a 100755 --- a/SocketIO.m +++ b/SocketIO.m @@ -81,16 +81,25 @@ @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]; _returnAllDataFromAck = NO; } +} + +- (id) initWithDelegate:(id)delegate +{ + self = [super init]; + if (self) { + _delegate = delegate; + } return self; } From 29940643f0ab16b6ff96da090df82e0fd16d7911 Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 5 May 2014 01:38:55 -0400 Subject: [PATCH 2/2] Issue # 176 --- SocketIO.m | 1 + 1 file changed, 1 insertion(+) diff --git a/SocketIO.m b/SocketIO.m index b5de39a..d7977c3 100755 --- a/SocketIO.m +++ b/SocketIO.m @@ -92,6 +92,7 @@ - (id) init _acks = [[NSMutableDictionary alloc] init]; _returnAllDataFromAck = NO; } + return self; } - (id) initWithDelegate:(id)delegate