我正在尝试将用Objective C编写的SocketClusteriOS (https://github.com/abpopov/SocketCluster-ios-client) pod添加到Swift项目中。我已经在Objective C项目中测试了this pod,url似乎工作正常,但当我试图将它添加到Swift项目中时,我遇到了奇怪的错误:
NewSocketTestApp[1641:29629] {"event":"#disconnect","data":
{"code":4005}}
#disconnect我可能会认为桥接头的问题。我将链接附加到我的测试应用程序存储库。https://github.com/davigr/SocketClusterSwift。SocketCluster-ios-client使用SocketRocket pod,我在桥接头中也提到了这个pod。不幸的是,当我尝试连接它时,它不能。我在Objective C项目中做了同样的代码,一切都很好。有人能帮我解决这个问题吗?可能是项目设置或桥接标头中的问题:
#ifndef Bridging_Header_h
#define Bridging_Header_h
#import "Pods/SocketCluster-ios-client/Pod/Classes/SCChannel.h"
#import "Pods/SocketCluster-ios-client/Pod/Classes/SCSocket.h"
#import "Pods/SocketCluster-ios-client/Pod/Classes/SCMessage.h"
#import "Pods/SocketRocket/SocketRocket/SocketRocket.h"
#import <Foundation/Foundation.h>
#import <CFNetwork/CFNetwork.h>
#import <Security/Security.h>发布于 2017-06-05 08:28:22
解决了,马上就可以和socket集群连接了
https://stackoverflow.com/questions/44340003
复制相似问题