realm

Storing an array of strings using Realm's RLMArray

为君一笑 提交于 2019-11-28 19:41:07
Does anyone know how you can use Realm to store an array of strings? I'm trying to map the following response into Realm correctly: "zoneInfo": { "tariffInfoLines": [ "In this city you pay per minute." ] } We have a zoneInfo object that contains a tariffInfoLines array. This tariffInfoLines array contains strings. In Realm there are two different variable types for storing data. The first is RLMObject which allows your standard NSString, int, long etc. The second type is RLMArray , which is used for arrays (as NSArray is not supported). You have to give the array a type, which must be a class

Realm & React Native - Best practice to implement auto-updates?

南笙酒味 提交于 2019-11-28 19:39:54
What are the best practices/patterns make realm a reactive datasource in a react native app? Especially for presentational and container components pattern ? Here is an example which I'd like to make reactive: Realm with React Native The docs on auto-updates/change-events are a bit thin and the official example does not make use of this feature (to my knowledge). Ari You can make your example reactive by subscribing to events and updating the ui when you receive a change event. Right now events are only sent when write transactions are committed, but finer grained change events will be added

shiro、ehcache教程

烈酒焚心 提交于 2019-11-28 19:28:25
权限概述(认证、授权) 系统提供了很多功能,并不是所有的用户登录系统都可以操作这些功能。我们需要 对用户的访问进行控制 。 登录用户-【超级管理员】-【客服】-【快递员】-【人事】- 【财务】-角色 认证:系统提供的用于识别用户身份的功能(通常是登录功能)----- 让系统知道你是谁 授权:系统提供的赋予用户访问某个功能的能力----- 让系统知道你能做什么 常见的权限控制的方式 第一种:URL拦截权限控制(基于过滤器或者拦截器) 第二种:方法注解权限控制(基于代理技术) 权限模块数据模型 权限的表设计 用户表:t_user 用户角色关系表:user_role 角色表:auth_role 角色权限关系表:role_function 权限表:auth_function apache shiro Apache Shiro 简介 是一个强大而灵活的开源安全框架,它能够干净利落地 处理身份认证,授权,企业会话管理和加密 。 使用 Shiro,您就能够为您的应用程序提供安全性而又无需从头编写所有代码。 官网: http://shiro.apache.org/ 提供的功能 Apache Shiro 能做的事情 验证用户 对用户执行访问控制,如: 判断用户是否拥有角色admin。 判断用户是否拥有访问的权限 在任何环境下使用 Session API。例如CS程序。 可以使用多个用户数据源

Realm object has been deleted or invalidated

微笑、不失礼 提交于 2019-11-28 19:05:37
When I start my app, I perform an API call to see whether there's new data available. The data is stored in my local Realm database, and some of it is displayed in the initial table view controller. Once the API call is finished, I check if some conditions are met that require me to delete a bunch of the previous data from the database and then create new objects. However, when I delete the old data, my app crashes with the following exception: 2015-08-06 11:56:32.057 MSUapp[19754:172864] *** Terminating app due to uncaught exception 'RLMException', reason: 'Object has been deleted or

How to organize React Native with Realm project files?

亡梦爱人 提交于 2019-11-28 17:37:08
问题 I've picked realm to store data in my React Native app. I don't understand, how to organize files in my project. Documentation provides only simple code for one component. But I need for different components different parts of database. I seen in one repository, where all schemes was passed to array in "configureRealm.js" file: new Realm({schema: [Dogs, Cats]}); Also I've found, that I can put different schemes in "schemes" directory, for example and import them where I need. For example in

Realm - Add file with initial data to project (iOS/Swift)

点点圈 提交于 2019-11-28 16:32:11
问题 I'm developing an application for iOS using swift and chose Realm as a database solution for it. I wrote default data in AppDelegate using write/add function from realm docs and it works just fine. So after first launch I have a *.realm file with my initial data. In Realm documentation I found a section called "Bundling a Realm with an App", I add my *.realm file to project and to Build Phases as it written. And I can't understand what I should do next (and part about compressing a *.realm

Using enum as property of Realm model

那年仲夏 提交于 2019-11-28 16:18:36
Is it possible to use an Enum as a property for my model? I currently have a class like this: class Checkin: RLMObject { dynamic var id: Int = 0 dynamic var kind: String = "checked_in" var kindEnum: Kind = .CheckedIn { willSet { self.kind = newValue.rawValue } } enum Kind: String { case CheckedIn = "checked_in" case EnRoute = "en_route" case DroppedOff = "dropped_off" } .... } It works okay, but I'd like to be able to have the kind property be the Enum and have Realm automatically call .rawValue on the property when it is saving an object to the store. Is this possible in Realm or is there a

Watchkit & Realm 0.92.3

☆樱花仙子☆ 提交于 2019-11-28 14:12:41
The Swift integration of a new Realm-DB (realm 0.92.3) under Xcode 6.3 and iOS10.10.3 basically works for the iPhone (not for the Apple-Watch yet). The integration of the same realm-framework under Watchkit (i.e. Apple-Watch) does not work yet. The RealmSwift.framework is integrated (dragged into) the Embedded-Binaries as described here1 and here2 . See screenshot below : When running the Watchkit-App with the simulator the following error occurs : dyld: Library not loaded: @rpath/libswiftCore.dylib Referenced from: /Users/XXX/Library/Developer/CoreSimulator/Devices/3FE99-9-4C4C2/data

Realm crashes with RLMException: object has been deleted or invalidated

青春壹個敷衍的年華 提交于 2019-11-28 13:56:00
I have a realm model that stores time line (i am making video editing app) and quite frequently it crushes on accessing it's RMArray property. The app is already shipped and I haven't experienced it myself but my crushlytics notifies me about this crash quite oftenly. Here is the crash log: Fatal Exception: RLMException Object has been deleted or invalidated. Thread : Fatal Exception: RLMException 0 CoreFoundation 0x2614d45f __exceptionPreprocess + 126 1 libobjc.A.dylib 0x3407ec8b objc_exception_throw + 38 2 VideoEditor 0x00293919 RLMGetArray(RLMObjectBase*, unsigned int, NSString*) (RLMRealm

How can I serialize a RealmObject to JSON in Realm for Java?

可紊 提交于 2019-11-28 13:27:00
I am implementing a DB for my Application and I am trying "connect" it to my REST interface. The data comes in as JSON and with the new JSON-Support (as of Realm 0.76) I can throw the JSON at my Realm.createObjectFromJson(MyType.class, jsonString) and it creates the appropiate obejcts and RealmLists. But how can I do the opposite? That is, take a RealmObject and serialize it to JSON? It also should serialize any RealmList inside that object. Christian from Realm here. Realm for Android currently doesn't have any such methods, although the core database actually supports JSON serialisation, so