【发布时间】:2017-01-14 20:01:51
【问题描述】:
我尝试通过 cocoapods 使用 RealmSwift,但我收到没有这样的模块“RealmSwift”错误。
pod 安装成功,安装 Realm 2.2.0
我已经尝试过干净的构建和构建文件夹以及派生数据 我还创建了一个虚拟项目并进行了全新安装,但它仍然无法正常工作。 当我尝试导入 RealSwift 并构建时,构建成功,但之后又出现错误。
这是我的 Podfile
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'RealmDummyProject' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for RealmDummyProject
pod 'RealmSwift'
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '3.0' # or '3.0'
end
end
end
end
我正在使用带有 Swift 3.0 的 Xcode 版本 8.1 (8B62) 谢谢!
【问题讨论】:
-
“当我尝试导入 RealSwift 并构建时,构建成功,但之后又出现错误。” – 这是否意味着您能够编译和运行应用程序?
-
是,首次启动工作区时
-
在这种情况下,Xcode 可能只是缓存了一些以前的错误,请尝试清理项目和构建文件夹,重新启动 Xcode 等并重建应用程序。
标签: realm