realm

Subquery and IN Statement in realm

匿名 (未验证) 提交于 2019-12-03 01:25:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have three realm objects. Department, section and user. section is a kind of sub department in a department. But there will be users under each section and each department. @interface Department : RLMObject @property NSString *name; @property BOOL isCollapsed; @property (nonatomic, strong) RLMArray *sections; @property (nonatomic, strong) RLMArray *users; @end @interface Section : RLMObject @property NSString *name; @property BOOL isCollapsed; @property RLMArray *users; @end @interface User : RLMObject @property NSString *department;

Prevent Realm from overwriting a property when updating an Object

旧街凉风 提交于 2019-12-03 01:24:35
I've setup a REST API to realm object in iOS. However I've found an issue with creating a favorite flag in my object. I've created a favorite bool, however everytime the object is updated from the API it sets the favorite to default false again. Here I want this flag to not be updated, since the favorite only is stored locally. How can I achieve this? class Pet: Object{ dynamic var id: Int = 1 dynamic var title: String = "" dynamic var type: String = "" dynamic var favorite: Bool = false override class func primaryKey() -> String { return "id" } } CreateOrUpdate let pet = Pet() pet.id = 2 pet

Alamofire, Objectmapper, Realm: Nested Objects

匿名 (未验证) 提交于 2019-12-03 01:23:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm using Alamofire, Objectmapper, Realm and everything is working beside one thing: I can't map nested objects. class Voting: Object, Mappable { dynamic var votingID: String = "" dynamic var question: String = "" var votingOptions = List () required convenience init?(_ map: Map) { self.init() } func mapping(map: Map) { votingID String { return "votingID" } } class VotingOption: Object, Mappable{ dynamic var optionID: String = "" dynamic var text: String = "" required convenience init?(_ map: Map) { self.init() } func mapping(map: Map) {

realm in Xamarin, System.EntryPointNotfoundException when trying to use realm

匿名 (未验证) 提交于 2019-12-03 01:18:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have installed realm in a Xamarin app and when I try to use an object (count, write, etc) it gives me a System.EntryPointNotFoundException . Below code: _realm = Realm.GetInstance(); _realm.Write(() => { var myConfig = _realm.CreateObject<Config>(); myConfig.Email = ""; myConfig.User = ""; }); System.EntryPointNotFoundException: shared_realm_begin_transaction at at (wrapper managed-to-native) Realms.NativeSharedRealm:begin_transaction (Realms.SharedRealmHandle) at Realms.Transaction..ctor (Realms.SharedRealmHandle sharedRealmHandle)

Realm Exception &#039;value&#039; is not a valid managed object

匿名 (未验证) 提交于 2019-12-03 01:17:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm setting a property on a realm object with another realm object which is a different class, however I'm getting the error: 'value' is not avalid managed object. realmObject.setAnotherRealmObject(classInstance.returnAnotherRealmObjectWithValues()) The class instance receives anotherRealmObject constructor and returns it through the method with values from widgets: public ClassInstance(AnotherRealmObject anotherRealmObject){ mAnotherRealmObject = anotherRealmObject; } public AnotherRealmObject returnAnotherRealmObjectWithValues(){

Please ensure that at least one realm can authenticate these tokens

匿名 (未验证) 提交于 2019-12-03 01:17:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: So I have set up my shiro to have two Realms. A Username and Password Realm, using the standard UsernamePasswordToken. I have also set up a Custom Bearer Authentication Token that works off a token passed in from the user. If i just use my passwordValidatorRealm it works find, if no user is found throws unknown account, if password doesn’t match throws incorrect credentials, perfect. But as soon as i put in my tokenValidatorRealm it throws a org . apache . shiro . authc . AuthenticationException : Authentication token of type [

Realm access from incorrect thread in rx and dagger

匿名 (未验证) 提交于 2019-12-03 01:08:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I know this question asks a lot but i am confused by reading this question.In my project i am using dagger, rx and realm in mvp pattern.I have an application with a LoginActivity that when the user login correctly, the user information that comes from server store in realm in this page and user jumps to MainActivity.In MainActivity i want this user info but i got this error: java.lang.IllegalStateException: Realm access from incorrect thread. Realm objects can only be accessed on the thread they were created. I know that : Realm access from

Migrating, but still getting crash on &#039;RLMException&#039;, reason: &#039;Migration is required

匿名 (未验证) 提交于 2019-12-03 01:03:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Realm, 1th thing { RLMRealmConfiguration *config = [RLMRealmConfiguration defaultConfiguration]; config.schemaVersion = 2; config.migrationBlock = ^(RLMMigration *migration, uint64_t oldSchemaVersion) { }; config.objectClasses = @[[User class], [UsersMenuItem class]]; [RLMRealm migrateRealm:config]; } ... } I did add a property to the user object, the docu says the new realm should automigrate, but i get a crash *** Terminating

Realm: Module was created by an older version of compiler and could not build objective-c module

匿名 (未验证) 提交于 2019-12-03 00:56:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have followed the steps provided to add the framewowrk from this link https://realm.io/docs/swift/latest/ It gives this error what could be the issue? Is it because it is compiled with an older version of xcode, since I have the latest xcode 7 beta? If so, how would I solve this? 回答1: You'll have to wait for us to support Swift 2.0 ( #2062 ) before you can use Realm Swift in your Swift 2.0 project. Because the framework written in Swift which was built in the old version compiler is not able to use in Xcode 7. Therefore, it will be needed

Carthage update error: “GitHub API request failed: Bad credentials”

匿名 (未验证) 提交于 2019-12-03 00:52:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: Here is my Cartfile: # Kanna HTML parsing library github "tid-kijyun/Kanna" ~> 1.0 . 0 # Realm database/ORM github "realm/realm-cocoa" When I run carthage update I get this: $ carthage -- version Unrecognized command : '--version' . See `carthage help` . $ carthage update -- platform OSX *** Fetching realm - cocoa *** Fetching Kanna *** Skipped downloading realm - cocoa . framework binary due to the error : "GitHub API request failed: Bad credentials" *** Checking out realm - cocoa at "v0.98.3" *** Skipped downloading Kanna .