realm

Swift - encrypted realm db can still be accessed without key

最后都变了- 提交于 2019-12-25 14:05:07
问题 I probably do not understand the encryption of Realm propably and hope someone can help. I created a Realm database with encryption according to this example: https://github.com/realm/realm-cocoa/blob/master/examples/ios/swift-2.0/Encryption/ViewController.swift let configuration = Realm.Configuration(encryptionKey: "31234567890123456789012345678901234567890123456789012345678901234".dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)) let realm = try! Realm(configuration:

Swift: Realm - Update UI (Progress) while adding Data to DB

痴心易碎 提交于 2019-12-25 11:56:29
问题 I want to download a 7MB JSON-File and after that I want to add the Data (30000 Datasets) to realm. while looping through the Datasets it is not possible to update the UI (Label or something) let manager = Alamofire.SessionManager.default manager.session.configuration.timeoutIntervalForRequest = 20 manager.request( "http://myURL.json") .downloadProgress { progress in self.TitelLabel.text = "loading File :\(String(format: "%.0f", progress.fractionCompleted * 100))%" } .responseJSON { response

Xcode 9.1 - Ambigous reference to member filter

可紊 提交于 2019-12-25 09:31:49
问题 I already experienced this issue in the past, I fixed it. But today I just download the new Xcode version 9.1 and my App is not building anymore, I got : Ambiguous reference to member 'filter' I don't know why, this is not the piece of code I was working on. The app is building/compiling fine since weeks. When I check the Release Note on the Official Apple Website, I don't seem to find any reference to my issue. So here is the piece of code that was working perfectly 2 hours ago : var

How to build Realm using Swift 2.3?

僤鯓⒐⒋嵵緔 提交于 2019-12-25 09:05:05
问题 I have already change toolchain to swift 2.3 by export PATH=/Applications/Xcode-beta.app/Contents/Developer/Toolchains/Swift_2.3.xctoolchain/usr/bin:"${PATH}" And did Open the Xcode project -> Click on the Realm project -> RealmSwift target -> 'Build Settings' tab -> set Use Legacy Swift Language Version to Yes (if building for Swift 2.3) or No (if building for Swift 3). as Build realm for Swift 3 & Xcode 8 says. But what I get is still swift 3.0 version. Any idea? I looked into build.sh and

Realm for React Native 0.45

五迷三道 提交于 2019-12-25 08:39:00
问题 I read on the official docs of Realm for React Native that the Realm is not compatible for RN 0.45. What shall I do where downgrading RN is not an option? 回答1: realm-js v1.8.0 added support for versions of React Native that use the C++ JavaScript bridge. 来源: https://stackoverflow.com/questions/44637528/realm-for-react-native-0-45

realm not fetching data

不羁岁月 提交于 2019-12-25 07:59:56
问题 I have problem working with realm. findAll and findAllAsync doesnot return any data from realm. I am updating realm object from main thread like this. public void updatePhoto(final int ticketID) { realm.beginTransaction(); RealmResults ticketPhotos = realm.where(TicketPhoto.class).equalTo("TicketID", ticketID).findAll();` for (TicketPhoto ticketPhoto : ticketPhotos) { ticketPhoto.IsModified = true; } realm.commitTransaction(); } '$' At same time one background service is running for every

What is the best practice or design pattern to maintain sync activity across multiple views?

坚强是说给别人听的谎言 提交于 2019-12-25 07:49:56
问题 Scenario : Shared/Sync'd Realm. iOS/Swift App with multiple views. What is the best practice design pattern I should use to in order to maintain synchronisation in the background - and - provide automatic (real time) updates to multiple views? Looking at the extra task app - this makes sense but the app really only has one active view. What if I have multiple views? Should I destroy the Realm notification of data change and rebuild for each view? 回答1: The recommended way is the same as for a

Realm relation field always null [duplicate]

假如想象 提交于 2019-12-25 06:39:14
问题 This question already has answers here : Cannot retrieve field values from realm object, values are null in debugger (3 answers) Closed 2 years ago . There are my models: public class RChat extends RealmObject { @PrimaryKey private String Id; private RMyTest Test; public RChat() {} } and public class RMyTest extends RealmObject { @PrimaryKey private String myName; public RMyTest() { } } And I'm using like this: mRealm = Realm.getInstance(this); mRealm.beginTransaction(); final RChat chat =

Keep Android local DB (Realm) in sync with SQL Server with minimal network overhead

杀马特。学长 韩版系。学妹 提交于 2019-12-25 06:23:53
问题 The Situation I've been banging my head on this one for awhile. I have a local DB using Realm with a back end SQL Server DB. There are a few areas in my app where data can be changed very quickly (a checkbox for instance). The user has the ability to toggle data back and forth many times a second. So lets say the user in the matter of a second makes 10 changes. What I am trying to avoid is POSTing out to SQL Server 10 times in that second. Instead what I'd like to happen is have some sort of

why does clearing contents of realm table invalidate the object?

旧街凉风 提交于 2019-12-25 04:45:18
问题 I have a table for favourites and what I want to do is to clear the table of all data and then reload it with the contents of an array. Here is the code: //empty FavouritesRealm table and reload favouritesArray back into FavouritesRealm let clearTable = realm.objects(FavouritesRealm) try! realm.write{ for row in clearTable{ realm.delete(row) } for f in favouritesArray{ let favouriteRealm = FavouritesRealm() favouriteRealm.name = f.name favouriteRealm.price = f.price favouriteRealm.dbSource =