简体   繁体   English

Swift Project中的Objective C Pod-正确的桥接标题吗?

[英]Objective C pods in Swift Project - right bridging headers?

I am trying to add SocketClusteriOS ( https://github.com/abpopov/SocketCluster-ios-client ) pod written in Objective C to Swift project. 我正在尝试将用Objective C编写的SocketClusteriOS( https://github.com/abpopov/SocketCluster-ios-client )容器添加到Swift项目中。 I've tested the this pod in Objective C project, url seems working fine, but when I am trying to add it to Swift project I have strange errors: 我已经在Objective C项目中测试了这个pod,URL似乎工作正常,但是当我尝试将其添加到Swift项目时,我遇到了奇怪的错误:

NewSocketTestApp[1641:29629] {"event":"#disconnect","data":
{"code":4005}}
#disconnect

I might think the problem in bridging header. 我可能认为桥接标头中的问题。 I attached the link to my repository of test app. 我将链接附加到测试应用程序的存储库中。 https://github.com/davigr/SocketClusterSwift . https://github.com/davigr/SocketClusterSwift SocketCluster-ios-client uses SocketRocket pod, I mentioned this pod in my bridging header as well. SocketCluster-ios-client使用SocketRocket容器,我在桥接头文件中也提到了该容器。 Unfortunately, when I am trying connect it couldn't. 不幸的是,当我尝试连接时无法连接。 I did the same code in Objective C project, everything was fine. 我在Objective C项目中执行了相同的代码,一切都很好。 Could anyone help me to fix this issue? 谁能帮我解决这个问题? Maybe problem in Project settings or bridging headers My bridging header: 也许项目设置或桥接标题中存在问题我的桥接标题:

#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>

解决了,与套接字集群的链接将很快

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM