realm

RealmLog native Implementation not found

泄露秘密 提交于 2019-12-06 08:42:48
问题 I am trying to use Realm Mobile Database, but i have some issues : I installed a Realm Object Server, and i try to create a use with an activity. Here my RegisterActivity public class RegisterActivity extends AppCompatActivity implements SyncUser.Callback { private AutoCompleteTextView usernameView; private EditText passwordView; private EditText passwordConfirmationView; private View progressView; private View registerFormView; @Override protected void onCreate(Bundle savedInstanceState) {

exclude a Realm model class

我怕爱的太早我们不能终老 提交于 2019-12-06 07:30:25
问题 I have two Realm files configured in my app. I want to store my Log model to a separate file from the rest of my models. My problem is that I also see my Log model class in my default Realm file, which I don't want. How can I exclude a particular model class from a given Realm file? I use the default configuration for my main Realm file, and I want to store the Log model only in another database file, but when I default.realm in the Realm Browser it also shows the Log model. 回答1: You can

Swift 3: Property observer for singleton

▼魔方 西西 提交于 2019-12-06 06:57:04
问题 I wonder if there's any way to observe singleton class for changes in ony of its property In my case, with Realm I have something like this class User: Object { dynamic var name:String = "" dynamic var email:String = "" dynamic var id:String = "" dynamic var picURL:String = "" dynamic var pic:Data = Data() static let currentUser = User() { didSet { try! realm.write { realm.add(currentUser, update: true) } } } } What I want to achieve is I want to have only one user object in my app, and

Deleting with one-to-many relationship

家住魔仙堡 提交于 2019-12-06 06:53:20
问题 I have a one-to-many relationship: class GameSystem: Object { dynamic var gameSystemName = "" } class games: Object { dynamic var gameSystemName = gameSystemName().name dynamic var gameTitle = "" dynamic var gameGenre = "" } The gameSystemName s are currently displayed on a TableView. If the user deletes a gameSystemName , I want that gameSystemName along with all of that system's games deleted. The code I'm currently using will only delete the GameSystem , but leaves all the games. func

Android: Change old primary key in realm migration

亡梦爱人 提交于 2019-12-06 06:39:23
问题 Can I change old primary key with new primary key in realm migration script? 回答1: Yes, it is possible. RealmObjectSchema objectSchema = schema.get("MyObject"); objectSchema.addField("newId", long.class) .transform(new RealmObjectSchema.Function() { @Override public void apply(DynamicRealmObject obj) { obj.setLong("newId", getNewId(obj)); } }) .removeField("id") .renameField("newId", "id") .addPrimaryKey("id"); However, you can't directly create the field as objectSchema.addField("newId", long

Anonymous user in Realm Mobile Platform

拟墨画扇 提交于 2019-12-06 06:13:17
问题 Can I connect to a remote Realm without having to login? In Swift, the only way to create a synchronizable Realm is through the syncConfiguration property of a Realm.Configuration . Is there a method for getting an anonymous User so that anyone can connect to the remote Realm? 回答1: Can I connect to a remote Realm without having to login? No, you always need to be authenticated. Is there a method for getting an anonymous User so that anyone can connect to the remote Realm? Yes, via

Retrieve the List property count of realm for tableview Swift

强颜欢笑 提交于 2019-12-06 06:07:54
I am using Realm 3 and Swift 4 and still new to Realm and Swift. Need a guidance here :) Given this realm model class Person: Object, Mappable { let dog = List<Dog>() required convenience init?(map: Map) { self.init() } } How can I get the dog count of each person? What i want to achieve is there are multiple sections on my table view and for each person there will be dog list for the respective person. func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { let owner = realm.objects(Person.self) return owner.dog.count // This is not working. What should I change

Saving Nested Objects to Realm Database in .Net

大憨熊 提交于 2019-12-06 06:05:53
I'm new to realm and I'm having a lot of trouble getting a nested object to save. I can save the parent, but I get a Realms.Exceptions.RealmObjectManagedByAnotherRealmException saying Cannot start to manage an object with a realm when it's already managed by another realm . I only have one realm and I'm creating a new object! This is what the parent class looks like: public class Transaction : RealmObject { [PrimaryKey] public string ID { get; set; } = Guid.NewGuid().ToString(); ... public IList<TransactionDetails> Rows { get; } } and here is the child: public class TransactionDetails :

Realm.open vs new Realm

ε祈祈猫儿з 提交于 2019-12-06 06:03:02
问题 In the context of a React Native app, using Realm locally only (so no realm object server for now). What is the difference between opening a realm using Realm.open({schema: [Car, Person]}) and creating a new Realm instance with new Realm({schema: [Car, Person]}); When should I use one or the other? Looks like Realm.open is just a callback to make sure the syncronisation is done, so only needed for synced Realms? So far this is what I found: Realm.open: According to the doc reference Realm

io.realm.RealmObject not found

狂风中的少年 提交于 2019-12-06 05:59:39
In my android library project, i install Realm as a Gradle plugin (as described in https://realm.io/docs/java/latest/ ). When I add my library project (aar file) into my application project, it can not build with error "cannot access RealmObject class file for io.realm.RealmObject not found" I have to install realm plugin in application project to overcome this error. Anyone can help me this situation, i do not want install realm plugin in application project. i do not want install realm plugin in application project. I afraid you have to. Why not? You could try to add those dependencies to