Closed shokaveli closed 6 years ago
self.queue = dispatch_get_main_queue(); is returning nil
That is really weird. What kind of app are you working on?
so I was able to fix by supplying the queue in my session init >
_session = [[MQTTSession alloc] initWithClientId:_clientId userName:_serverUsername password:_serverPassword keepAlive:WWMQCLIENT_DEFAULT_KEEPALIVE cleanSession:WWMQCLIENT_DEFAULT_CLEANSESSION will:NO willTopic:nil willMsg:nil willQoS:WWMQCLIENT_DEFAULT_QOS willRetainFlag:NO protocolLevel:3 queue:dispatch_get_main_queue() securityPolicy:nil certificates:nil];
Before I was setting it to nil like so >
_session = [[MQTTSession alloc] initWithClientId:_clientId userName:_serverUsername password:_serverPassword keepAlive:WWMQCLIENT_DEFAULT_KEEPALIVE cleanSession:WWMQCLIENT_DEFAULT_CLEANSESSION will:NO willTopic:nil willMsg:nil willQoS:WWMQCLIENT_DEFAULT_QOS willRetainFlag:NO protocolLevel:3 queue:nil securityPolicy:nil certificates:nil];
Hopefully this is how I am supposed to do it.
It doesnt crash anymore but my connection is timing out, possibly from a separate issue though.
I think it is really weird that you get nil from dispatch_get_main_queue
. But on another hand I don't think that is problem in this framework. If you suspect it might be please add some more info.
Yea i dont think it was a framework issue
Im crashing here due to _queue = nil. This started happening only after updating to latest version of MQTT-Client-Framework. Please help.