【发布时间】:2015-10-19 17:16:23
【问题描述】:
我正在尝试在 Swift 中创建一个名为 CouchbaseKit(Xcode 中的新目标)的自定义框架。在我的CouchbaseKit 中,我需要访问完全用Obj-C 编写的CouchBaseLite Framework。我使用Cocoapods 来管理CouchBaseLite 和其他几个框架。下面是我的 podfile。
Podfile
# Uncomment this line to define a global platform for your project
link_with ['CouchbaseKit']
# platform :ios, '8.0'
use_frameworks!
target 'CouchbaseDB' do
link_with ['CouchbaseKit']
pod 'couchbase-lite-ios'
pod 'SwiftyJSON', '~> 2.2.0'
pod 'Alamofire', '~> 1.2'
pod 'XCGLogger', '~> 2.0'
end
target 'CouchbaseDBTests' do
end
target 'CouchbaseKit' do
end
target 'CouchbaseKitTests' do
end
项目内的 Pod:
对于我的 TARGETS,我在 Build Phases 中有以下设置。
定义模块是
允许框架模块中的非模块化包含是
问题: 当我尝试访问我的 CouchbaseKit(我的自定义框架)中的 CouchbaseLite 框架时,我收到一个错误,“没有这样的模块 'CouchbaseLite' 不存在。
试过了:
-
由于项目使用 Swift,我创建了一个 Objective-C 文件并点击“您想配置一个 Objective-C 桥接头吗?”
即使在所有目标中将“框架模块中的允许非模块化包含”设置为“是”,当我尝试在
CouchbaseKit.h中输入#import <CouchbaseLite/CouchbaseLite.h>时仍然会出错
这是我的自定义框架 CouchbaseKit 的构建阶段的样子
问题:如何在我的自定义 Swift 框架中查看外部 Objective-C 框架 (CouchasebaseLite)?
【问题讨论】:
-
试试看this repo,看看你能不能从中得到任何线索。
标签: ios8 frameworks xcode6 couchbase-lite