按照官网的升级完socket.io报错Manager is being released。

按照官网的升级完socket.io报错Manager is being released。_第1张图片

查阅了很多资料和英文官网自己也提出了一些问题,估计官网以前有该类的问题历史,懒得回复。

按照官网的升级完socket.io报错Manager is being released。_第2张图片

 

终于功夫不负有心人原因竟然是:你的manager被释放了。

按照官网的升级完socket.io报错Manager is being released。_第3张图片

 

you need to make sure the SocketManager is held strongly, not released by arc.

like this init:

First->

@Property(nonatomic,strong)SocketManager* manager;


And then->

NSURL* url = [[NSURL alloc] initWithString:socketUrl];
_manager = [[SocketManager alloc] initWithSocketURL:url config:@{@"log": @no, @"forcePolling": @yES,@"reconnectWait":@1}];
ChatSocket = _manager.defaultSocket;

 

这样就好了。

转载于:https://www.cnblogs.com/PeterWolf/p/11504735.html

你可能感兴趣的:(按照官网的升级完socket.io报错Manager is being released。)