xcode Xcode9 领域错误 - 没有可行的重载“=”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/44448282/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Xcode9 Realm Error - No viable overloaded ‘=’
提问by Jone
I just install Xcode 9 and build my native iOS project. (Is written in swift)
我只是安装了 Xcode 9 并构建了我的原生 iOS 项目。(是用swift写的)
The project was OK in Xcode 8 but now, I obtain this error:
该项目在 Xcode 8 中正常,但现在,我收到此错误:
No viable overloaded '='
No viable overloaded '='
In the file: Pods\Pods\Realm\object.cpp
在文件中:Pods\Pods\Realm\object.cpp
Line 42 => m_notifier = std::make_shared<_impl::ObjectNotifier>(m_row, m_realm);
第 42 行 => m_notifier = std::make_shared<_impl::ObjectNotifier>(m_row, m_realm);
回答by antonioduarte
If you are using Cocoapods, open up the Podfile and set the RealmSwift version to 2.8.1 (or 2.8.3 as David mentioned above). Here is my Podfile for Swift 3.0 using Xcode 9:
如果您使用 Cocoapods,请打开 Podfile 并将 RealmSwift 版本设置为 2.8.1(或 David 上面提到的 2.8.3)。这是我使用 Xcode 9 的 Swift 3.0 Podfile:
target ‘<PROJECT>' do
use_frameworks!
# Pods
...
pod 'RealmSwift', '2.8.1'
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '3.0'
end
end
end
Then, save the file and run:
然后,保存文件并运行:
pod install
吊舱安装
If you're not setting a specific pod version (which I recommend), run the following command:
如果您没有设置特定的 pod 版本(我推荐),请运行以下命令:
pod update RealmSwift
pod 更新 RealmSwift
and it will automatically update to the most recent version (2.8.3).
它会自动更新到最新版本(2.8.3)。
Hope it helps to complement David's answer. Thanks!
希望它有助于补充大卫的回答。谢谢!
回答by David Fournier
The Realm team has worked on a new version allowing you to build your project with XCode 9.
Just update your Realm version to at least 2.8.1
(current version is 2.8.3
)
Realm 团队开发了一个新版本,允许您使用 XCode 9 构建项目。只需将您的 Realm 版本至少更新为2.8.1
(当前版本为2.8.3
)
https://github.com/realm/realm-cocoa/releases/tag/v2.8.1
https://github.com/realm/realm-cocoa/releases/tag/v2.8.1
The Realm release note of 2.8.1
clearly states :
Realm 发行说明2.8.1
明确指出:
Add support for building with Xcode 9 Beta 1.
添加对使用 Xcode 9 Beta 1 构建的支持。