沒有人知道下面的領域功能的try-catch語法是? realm.write() {
realm.add(whatever)
}
,我發現了以下錯誤: call can throw but it is not marked with 'try' and the error is not handled
假設未來情況: //I don't put the getters and setters, but assume they are there
public class User extends RealmObject {
private RealmList<Dog> dogs;
}
public class Dog extends RealmObject {
//U
比方說,我有 class A
{
dynamic var id = 0
dynamic var text = ""
}
class B
{
dynamic var id = 0
let collection = List<A>
}
我想知道如果Int(IDS)的陣列包含在B.collection(匹配id屬性)。這樣 realm.object
我剛剛爲我的Realm模型添加了主鍵,因此我一直收到以下錯誤。我試圖在appdelegate中遷移,但仍然得到了錯誤。我所做的只是添加propertyKey()功能。我如何正確遷移? Migration is required for object type 'Organization' due to the following errors:
- Property 'id' has been