'User' has a primary key

2017-10-26  本文已影响157人  03a9db709e59

Primary keys are immutable since Realm 2.0.0, which means you cannot modify them after the object has been created. So pass it at the time of object creation.

Useruser=realm.createObject(User.class,UUID.randomUUID().toString());user.setFirstName("Theo");user.setLastName("Larsen");

文章出处:https://stackoverflow.com/questions/41046279/user-has-a-primary-key-use-createobjectclasse-object-instead

上一篇 下一篇

猜你喜欢

热点阅读