2017-06-09 115 views
12

我只是安裝了Xcode 9並構建了我的原生iOS項目。 (寫的是SWIFT)Xcode9 Realm Error - No viable overloaded'='

該項目是在Xcode 8 OK,但現在,我得到這個錯誤:

No viable overloaded '='

在文件:莢\莢\域\ object.cpp

線42 =>m_notifier = std::make_shared<_impl::ObjectNotifier>(m_row, m_realm);

+0

m_notifier'''是什麼類型的?可能是因爲基類沒有正確地重載=運算符 – mutantkeyboard

+0

感謝您的回覆。類型是_impl :: CollectionNotifier :: Handle <_impl :: ObjectNotifier> m_notifier;'在'Object'類中。 – Jone

回答

4

境界團隊已經上了一個新版本的工作,讓您與XCode中生成項目9 只需更新境界版本至少2.8.1(CU rrent版本是2.8.3

https://github.com/realm/realm-cocoa/releases/tag/v2.8.1

境界發行說明2.8.1明確規定:

Add support for building with Xcode 9 Beta 1.

11

如果您正在使用的CocoaPods,開拓Podfile和RealmSwift版本設置爲2.8.1(或大衛提到的2.8.3)。這是我Podfile雨燕爲3.0使用的Xcode 9:

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 

然後,保存文件並運行:

pod install

如果你沒有設置特定的吊艙版本(我推薦),運行以下命令:

pod update RealmSwift

它會自動更新到最新版本(2.8.3)。

希望它有助於補充大衛的答案。謝謝!

相關問題