[英]SocketRocket crashes after connectionDidFinishLoading
So i want to develop a basic chat application using socket.io. 所以我想使用socket.io开发一个基本的聊天应用程序。 I'm using this framework which is essentially just a wrapper over SocketRocket.
我正在使用这个框架,它实际上只是SocketRocket的包装。
Now i made a connectToHost:onPort and i receive a 200 in didReceiveResponse. 现在我做了一个connectToHost:onPort,我在didReceiveResponse中收到了200。 The connectionDidFinishLoading also is called.
connectionDidFinishLoading也被调用。 It finally prints Opening URL_NAME in the openSocket method before i get a EXC_BAD_ACCESS at this method:
最后,在我通过此方法获得EXC_BAD_ACCESS之前,它会在openSocket方法中打印Opening URL_NAME:
[self _performDelegateBlock:^{
if ([self.delegate respondsToSelector:@selector(webSocketDidOpen:)]) { // <- EXC_BAD_ACESSS error here
[self.delegate webSocketDidOpen:self];
};
}];
Any idea what it could be? 知道会是什么吗? From my understanding, the framework i'm using should implement this delegate method of Socket Rocket.
据我了解,我使用的框架应该实现Socket Rocket的委托方法。
Thanks in advance! 提前致谢!
Finally found the error and it was rather silly. 终于发现了错误,这很愚蠢。 I should have created a class variable of the SocketIO instance.
我应该已经创建了SocketIO实例的类变量。 Thats why the life cycle was over and the delagate was nil.
这就是为什么生命周期结束且滞后物为零的原因。 Ah well!
呃,好吧!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.