Skip to content
This repository has been archived by the owner on May 14, 2024. It is now read-only.

Init is not properly defined. #176

Open
ArEnSc opened this issue May 5, 2014 · 0 comments
Open

Init is not properly defined. #176

ArEnSc opened this issue May 5, 2014 · 0 comments

Comments

@ArEnSc
Copy link

ArEnSc commented May 5, 2014

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.
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.

ArEnSc pushed a commit to ArEnSc/socket.IO-objc that referenced this issue May 5, 2014
…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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant