gpt4 book ai didi

swift - 'RLMException',原因 : 'Opening Realm files of format version 11 is not supported by this version of Realm'

转载 作者:行者123 更新时间:2023-12-04 09:31:49 24 4
gpt4 key购买 nike

我正在尝试登录 Realm ,但它不断抛出 RLMException 错误。
这是我的 pod 文件

# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'

target 'App' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!

# Pods for App
pod 'RealmSwift'

target 'AppUITests' do
# Pods for testing
end

end
这是登录功能
func login(){

let usernameCredentials = SyncCredentials.usernamePassword(username: "user", password: "password")
// Create the configuration
let syncServerURL = URL(string: "realms://jaffjf.faf.cloud.realm.io/default")!
SyncUser.logIn(with: usernameCredentials, server: syncServerURL) { user, error in
if let user = user {
print("logged in",user)
let config = user.configuration(realmURL: syncServerURL);

// Open the remote Realm
let realm = try! Realm(configuration: config)


Realm.asyncOpen(configuration: config) { realm, error in
if let realm = realm {

let results = realm.objects(Temp.self)
print("This is the results......", results)


} else if let error = error {

print("No realm found....")
}
}

} else if let error = error {

}
}

Terminating app due to uncaught exception 'RLMException', reason: 'Opening Realm files of format version 11 is not supported by this version of Realm'*** First throw call stack:


是什么导致了错误,我该如何解决?

最佳答案

此错误表明您需要使用 Realm Cocoa 5.4.x,此时最新版本是 5.4.5。

关于swift - 'RLMException',原因 : 'Opening Realm files of format version 11 is not supported by this version of Realm' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62813808/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com