3
我只是好奇,如果我打電話realm.create
,它會自動更新realm object from the realm results
?Realm.create是否會用相同的主鍵更新對象?
// Assuming a "Book" with a primary key of `1` already exists.
try! realm.write {
realm.create(Book.self, value: ["id": 1, "price": 9000.0], update: true)
// the book's `title` property will remain unchanged.
}
目前看來我需要再次從領域讀取以獲取最新的對象。如果我錯了,請糾正我。
感謝
感謝您的驗證和詳細的演示!事實證明,我的鑰匙有錯字! – perwyl