按照官网的升级完socket.io报错Manager is being released。
查阅了很多资料和英文官网自己也提出了一些问题,估计官网以前有该类的问题历史,懒得回复。
终于功夫不负有心人原因竟然是:你的manager被释放了。
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;
这样就好了。