socket.IO-objc
socket.IO-objc copied to clipboard
Init is not properly defined.
When using init without setting the id<socketIODelegate> 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. That is incorrect.
Following changes allow init to be used if not used with a delegate and allow the library to function.
- (id) init
{
self = [super init];
if (self) {
_delegate = nil;
_queue = [[NSMutableArray alloc] init];
_ackCount = 0;
_acks = [[NSMutableDictionary alloc] init];
_returnAllDataFromAck = NO;
}
return self;
}
- (id) initWithDelegate:(id<SocketIODelegate>)delegate
{
self = [super init];
if (self) {
_delegate = delegate;
}
return self;
}
the pull request is available.