realm

How to set primary key auto increment in realm android

烂漫一生 提交于 2019-12-18 12:47:42
问题 I want to set primary key auto increment for my table. Here is my Class. I have set primary key but I want it to be auto increment primary key. public class users extends RealmObject { @PrimaryKey private int id; private long icn; private String name; private String email; private String password; private int phone; public String getName() { return name; } public int getId() { return id; } public void setId(int id) { this.id = id; } public long getIcn() { return icn; } public void setIcn(long

Bundle prebuilt Realm files from Xamarin

☆樱花仙子☆ 提交于 2019-12-18 11:42:18
问题 I've seen a few SO posts detailing how you bundle prebuilt Realm files with iOS (Obj-c/swift) and Android (Java), but I can't find any information on bundling with Xamarin from a PCL or shared project; is this possible? I believe it would require a per-project *.realm file (e.g. copied from a single source at compile time) due to the nuances of how files are distributed in each platform, but that's a small price to pay to be able to access prebuilt data from shared code on both platforms. My

Realm Swift Models separate or not?

南笙酒味 提交于 2019-12-18 10:58:20
问题 I'm new to the world of iOS and Swift and am working on a new app which I want to use Realm for persistence. I have Entities in my code already which my Services access and populate for an HTTP API endpoint. Now I want to persist certain Entities and wanted advice as to whether I should create new Realm specific Models for each of my entities to read and write from Realm. Or should I convert all my existing plain Swift Entities to Realm Entities. At first this felt wrong as I would be passing

Clear complete Realm Database

无人久伴 提交于 2019-12-18 10:49:09
问题 I'm playing around with realm (currently 0.85.0) and my application uses the database to store user-specific data such as the contacts of the current user. When the user decides to log out I need to remove every single bit of information about the user and the most obvious, simple and clean thing in my opinion would be to wipe the complete realm. Unfortunately, the Cocoa lib doesn't provide that functionality. Currently, I'm stuck with the following RLMRealm *realm = [RLMRealm defaultRealm];

GitLab CI: iOS project issue (permission denied)

时光毁灭记忆、已成空白 提交于 2019-12-18 09:43:31
问题 Trying GitLab CI for my iOS project, I follow this, this and this tutorial. Two questions: What is wrong with my gitlab-runner (with "shell" registration) since GitLab CI throws the following error: Running with gitlab-runner 11.9.0 (692ae235) on MyApp runner with shell DsaBC-oQ Using Shell executor... Running on MyComputer.network.provider... mkdir: /Users/myusername/builds/DsaBC-oQ/0/username/myproj.tmp: Permission denied mkdir: /Users/myusername/builds/DsaBC-oQ/0/username/myproj.tmp:

Comparing Realm Object List

放肆的年华 提交于 2019-12-18 09:37:58
问题 I want to compare 2 Realm object Lists with each other to see if they are identical. Here is what the object looks like. class ScheduleRealm: Object { let scheduleList = List<Schedule>() } class Schedule: Object { dynamic var startTime : Date = Date() dynamic var endTime : Date = Date() dynamic var name : String = "" } When I print the 2 list: List<Schedule> ( [0] Schedule { startTime = 2017-07-03 16:00:00 +0000; endTime = 2017-07-03 18:00:00 +0000; name = Weights Mon, 3 Jul 16:00 120m; }, [1

“Object” is not part of the schema for this Realm

半城伤御伤魂 提交于 2019-12-18 08:52:41
问题 When I call the realm.where(MessageEventModel::class.java).findAll() it throws excepiton: this is error java.lang.IllegalArgumentException: MessageEventModel is not part of the schema for this Realm at io.realm.internal.modules.CompositeMediator.getMediator(CompositeMediator.java:172) at io.realm.internal.modules.CompositeMediator.getTableName(CompositeMediator.java:90) this is my Application class class MyApp : Application() { override fun onCreate() { super.onCreate() Realm.init(this) val

RealmSwift display for each date to tableview section

僤鯓⒐⒋嵵緔 提交于 2019-12-18 07:17:11
问题 I'm new in swift and realm. I want to display data which are stored in realm. I want to display for each date to tableview section. Item Object class Item: Object { @objc dynamic var amount: Int = 0 @objc dynamic var date: Date? var parentCategory = LinkingObjects(fromType: Category.self, property: "items") } viewController import UIKit import RealmSwift class HistoryViewController: UITableViewController { let realm = try! Realm() var items: Results<Item>? override func viewDidLoad() { super

Do we have to use explicit autorelease pool when using Realm in GCD even under ARC

半城伤御伤魂 提交于 2019-12-18 07:06:54
问题 It is said in Realm's doc: You may also see this problem when accessing Realm using Grand Central Dispatch. This can happen when a Realm ends up in a dispatch queue’s autorelease pool as those pools may not be drained for some time after executing your code. The intermediate versions of data in the Realm file cannot be reused until the RLMRealm object is deallocated. To avoid this issue, you should use an explicit autorelease pool when accessing a Realm from a dispatch queue. Does this mean

Realm dotnet - The rhs of the binary operator 'Equal' should be a constant or closure variable expression

*爱你&永不变心* 提交于 2019-12-18 06:24:12
问题 Hi have just started using Realm dotnet When I perform a simple query like var results = realm.All<MyRealmType>().Where(x => x.Property == otherVariable.Property); So in the Where clause I am comparing two strings to retrieve the data I need from the realm. I get the following error {System.NotSupportedException: The rhs of the binary operator 'Equal' should be a constant or closure variable expression at Realms.RealmResultsVisitor.VisitBinary (System.Linq.Expressions.BinaryExpression b)