IOS Swift Cocoapods - 安装和使用couchbase库

时间:2022-09-18 14:19:22

i want to use couchbase in my ios swift app and therefore installed the couchbase pod into my project.

我想在我的ios swift应用程序中使用couchbase,因此将couchbase pod安装到我的项目中。

Also added all header files to the Bridging-Header file, but the compiler cant resolve these links to the header files and is unable to find the class CBLManager.

还将所有头文件添加到Bridging-Header文件中,但编译器无法解析这些指向头文件的链接,并且无法找到类CBLManager。

Bridging-Header File - attempt 1

桥接头文件 - 尝试1

#import "CouchbaseLiteListener.framework/Headers/CBLListener.h"
#import "CouchbaseLite.framework/Headers/CBLAttachment.h"
#import "CouchbaseLite.framework/Headers/CBLAuthenticator.h"
#import "CouchbaseLite.framework/Headers/CBLDatabase.h"
#import "CouchbaseLite.framework/Headers/CBLDatabaseChange.h"
#import "CouchbaseLite.framework/Headers/CBLDocument.h"
#import "CouchbaseLite.framework/Headers/CBLGeometry.h"
#import "CouchbaseLite.framework/Headers/CBLJSON.h"
#import "CouchbaseLite.framework/Headers/CBLManager.h"
#import "CouchbaseLite.framework/Headers/CBLModel.h"
#import "CouchbaseLite.framework/Headers/CBLModelFactory.h"
#import "CouchbaseLite.framework/Headers/CBLQuery.h"
#import "CouchbaseLite.framework/Headers/CBLQuery+FullTextSearch.h"
#import "CouchbaseLite.framework/Headers/CBLQuery+Geo.h"
#import "CouchbaseLite.framework/Headers/CBLReplication.h"
#import "CouchbaseLite.framework/Headers/CBLRevision.h"
#import "CouchbaseLite.framework/Headers/CBLUITableSource.h"
#import "CouchbaseLite.framework/Headers/CBLView.h"
#import "CouchbaseLite.framework/Headers/CouchbaseLite.h"
#import "CouchbaseLite.framework/Headers/MYDynamicObject.h"

Bridging-Header File - attempt 2

桥接头文件 - 尝试2

#import "Pods/couchbase-lite-ios/Frameworks/CouchbaseLiteListener.framework/Headers/CBLListener.h"
#import "Pods/couchbase-lite-ios/Frameworks/CouchbaseLite.framework/Headers/CBLAttachment.h"
#import "Pods/couchbase-lite-ios/Frameworks/CouchbaseLite.framework/Headers/CBLAuthenticator.h"
#import "Pods/couchbase-lite-ios/Frameworks/CouchbaseLite.framework/Headers/CBLDatabase.h"
#import "Pods/couchbase-lite-ios/Frameworks/CouchbaseLite.framework/Headers/CBLDatabaseChange.h"
#import "Pods/couchbase-lite-ios/Frameworks/CouchbaseLite.framework/Headers/CBLDocument.h"
#import "Pods/couchbase-lite-ios/Frameworks/CouchbaseLite.framework/Headers/CBLGeometry.h"
#import "Pods/couchbase-lite-ios/Frameworks/CouchbaseLite.framework/Headers/CBLJSON.h"
#import "Pods/couchbase-lite-ios/Frameworks/CouchbaseLite.framework/Headers/CBLManager.h"
#import "Pods/couchbase-lite-ios/Frameworks/CouchbaseLite.framework/Headers/CBLModel.h"
#import "Pods/couchbase-lite-ios/Frameworks/CouchbaseLite.framework/Headers/CBLModelFactory.h"
#import "Pods/couchbase-lite-ios/Frameworks/CouchbaseLite.framework/Headers/CBLQuery.h"
#import "Pods/couchbase-lite-ios/Frameworks/CouchbaseLite.framework/Headers/CBLQuery+FullTextSearch.h"
#import "Pods/couchbase-lite-ios/Frameworks/CouchbaseLite.framework/Headers/CBLQuery+Geo.h"
#import "Pods/couchbase-lite-ios/Frameworks/CouchbaseLite.framework/Headers/CBLReplication.h"
#import "Pods/couchbase-lite-ios/Frameworks/CouchbaseLite.framework/Headers/CBLRevision.h"
#import "Pods/couchbase-lite-ios/Frameworks/CouchbaseLite.framework/Headers/CBLUITableSource.h"
#import "Pods/couchbase-lite-ios/Frameworks/CouchbaseLite.framework/Headers/CBLView.h"
#import "Pods/couchbase-lite-ios/Frameworks/CouchbaseLite.framework/Headers/CouchbaseLite.h"
#import "Pods/couchbase-lite-ios/Frameworks/CouchbaseLite.framework/Headers/MYDynamicObject.h"

I allready did the same with AFNetworking and this is working fine.

我已经对AFNetworking做了同样的事情,这很好。

2 个解决方案

#1


0  

Found the solution

找到了解决方案

#import "Pods/couchbase-lite-ios/CouchbaseLiteListener.framework/Headers/CBLListener.h"
#import "Pods/couchbase-lite-ios/CouchbaseLite.framework/Headers/CBLAttachment.h"
#import "Pods/couchbase-lite-ios/CouchbaseLite.framework/Headers/CBLAuthenticator.h"
#import "Pods/couchbase-lite-ios/CouchbaseLite.framework/Headers/CBLDatabase.h"
#import "Pods/couchbase-lite-ios/CouchbaseLite.framework/Headers/CBLDatabaseChange.h"
#import "Pods/couchbase-lite-ios/CouchbaseLite.framework/Headers/CBLDocument.h"
#import "Pods/couchbase-lite-ios/CouchbaseLite.framework/Headers/CBLGeometry.h"
#import "Pods/couchbase-lite-ios/CouchbaseLite.framework/Headers/CBLJSON.h"
#import "Pods/couchbase-lite-ios/CouchbaseLite.framework/Headers/CBLManager.h"
#import "Pods/couchbase-lite-ios/CouchbaseLite.framework/Headers/CBLModel.h"
#import "Pods/couchbase-lite-ios/CouchbaseLite.framework/Headers/CBLModelFactory.h"
#import "Pods/couchbase-lite-ios/CouchbaseLite.framework/Headers/CBLQuery.h"
#import "Pods/couchbase-lite-ios/CouchbaseLite.framework/Headers/CBLQuery+FullTextSearch.h"
#import "Pods/couchbase-lite-ios/CouchbaseLite.framework/Headers/CBLQuery+Geo.h"
#import "Pods/couchbase-lite-ios/CouchbaseLite.framework/Headers/CBLReplication.h"
#import "Pods/couchbase-lite-ios/CouchbaseLite.framework/Headers/CBLRevision.h"
#import "Pods/couchbase-lite-ios/CouchbaseLite.framework/Headers/CBLUITableSource.h"
#import "Pods/couchbase-lite-ios/CouchbaseLite.framework/Headers/CBLView.h"
#import "Pods/couchbase-lite-ios/CouchbaseLite.framework/Headers/CouchbaseLite.h"
#import "Pods/couchbase-lite-ios/CouchbaseLite.framework/Headers/MYDynamicObject.h"

#2


0  

Using the couchbase-lite-ios 1.2.0 pod, I was able to use a single line in my bridging header:

使用couchbase-lite-ios 1.2.0 pod,我能够在我的桥接头中使用一行:

#import "couchbase-lite-ios/CouchbaseLite/CouchbaseLite.h"

#1


0  

Found the solution

找到了解决方案

#import "Pods/couchbase-lite-ios/CouchbaseLiteListener.framework/Headers/CBLListener.h"
#import "Pods/couchbase-lite-ios/CouchbaseLite.framework/Headers/CBLAttachment.h"
#import "Pods/couchbase-lite-ios/CouchbaseLite.framework/Headers/CBLAuthenticator.h"
#import "Pods/couchbase-lite-ios/CouchbaseLite.framework/Headers/CBLDatabase.h"
#import "Pods/couchbase-lite-ios/CouchbaseLite.framework/Headers/CBLDatabaseChange.h"
#import "Pods/couchbase-lite-ios/CouchbaseLite.framework/Headers/CBLDocument.h"
#import "Pods/couchbase-lite-ios/CouchbaseLite.framework/Headers/CBLGeometry.h"
#import "Pods/couchbase-lite-ios/CouchbaseLite.framework/Headers/CBLJSON.h"
#import "Pods/couchbase-lite-ios/CouchbaseLite.framework/Headers/CBLManager.h"
#import "Pods/couchbase-lite-ios/CouchbaseLite.framework/Headers/CBLModel.h"
#import "Pods/couchbase-lite-ios/CouchbaseLite.framework/Headers/CBLModelFactory.h"
#import "Pods/couchbase-lite-ios/CouchbaseLite.framework/Headers/CBLQuery.h"
#import "Pods/couchbase-lite-ios/CouchbaseLite.framework/Headers/CBLQuery+FullTextSearch.h"
#import "Pods/couchbase-lite-ios/CouchbaseLite.framework/Headers/CBLQuery+Geo.h"
#import "Pods/couchbase-lite-ios/CouchbaseLite.framework/Headers/CBLReplication.h"
#import "Pods/couchbase-lite-ios/CouchbaseLite.framework/Headers/CBLRevision.h"
#import "Pods/couchbase-lite-ios/CouchbaseLite.framework/Headers/CBLUITableSource.h"
#import "Pods/couchbase-lite-ios/CouchbaseLite.framework/Headers/CBLView.h"
#import "Pods/couchbase-lite-ios/CouchbaseLite.framework/Headers/CouchbaseLite.h"
#import "Pods/couchbase-lite-ios/CouchbaseLite.framework/Headers/MYDynamicObject.h"

#2


0  

Using the couchbase-lite-ios 1.2.0 pod, I was able to use a single line in my bridging header:

使用couchbase-lite-ios 1.2.0 pod,我能够在我的桥接头中使用一行:

#import "couchbase-lite-ios/CouchbaseLite/CouchbaseLite.h"