Skip to content

Commit

Permalink
When using init without setting the id<socketIODelegate> delegate on …
Browse files Browse the repository at this point in the history
…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 pkyeck#176
  • Loading branch information
Michael committed May 5, 2014
1 parent c7e5d27 commit fe279da
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions SocketIO.m
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,25 @@ @implementation SocketIO
heartbeatTimeout = _heartbeatTimeout,
returnAllDataFromAck = _returnAllDataFromAck;

- (id) initWithDelegate:(id<SocketIODelegate>)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<SocketIODelegate>)delegate
{
self = [super init];
if (self) {
_delegate = delegate;
}
return self;
}

Expand Down

0 comments on commit fe279da

Please sign in to comment.