{"action":"created","issue":{"url":"https://api.github.com/repos/realm/realm-cocoa/issues/3539","repository_url":"https://api.github.com/repos/realm/realm-cocoa","labels_url":"https://api.github.com/repos/realm/realm-cocoa/issues/3539/labels{/name}","comments_url":"https://api.github.com/repos/realm/realm-cocoa/issues/3539/comments","events_url":"https://api.github.com/repos/realm/realm-cocoa/issues/3539/events","html_url":"https://github.com/realm/realm-cocoa/issues/3539","id":153825997,"number":3539,"title":"Predicate on an Embedded RLMObject inside another RLMObject","user":{"login":"Chris59160","id":5450122,"avatar_url":"https://avatars.githubusercontent.com/u/5450122?v=3","gravatar_id":"","url":"https://api.github.com/users/Chris59160","html_url":"https://github.com/Chris59160","followers_url":"https://api.github.com/users/Chris59160/followers","following_url":"https://api.github.com/users/Chris59160/following{/other_user}","gists_url":"https://api.github.com/users/Chris59160/gists{/gist_id}","starred_url":"https://api.github.com/users/Chris59160/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Chris59160/subscriptions","organizations_url":"https://api.github.com/users/Chris59160/orgs","repos_url":"https://api.github.com/users/Chris59160/repos","events_url":"https://api.github.com/users/Chris59160/events{/privacy}","received_events_url":"https://api.github.com/users/Chris59160/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/realm/realm-cocoa/labels/S:Waiting%20For%20User","name":"S:Waiting For User","color":"ededed"},{"url":"https://api.github.com/repos/realm/realm-cocoa/labels/T:Help","name":"T:Help","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-05-09T17:19:54Z","updated_at":"2016-05-09T18:25:08Z","closed_at":null,"body":"Hello guys,\r\n\r\nI have a problem I am not sure how to sort it out.\r\n\r\nI have a RLMObject 'A' that has another RLMObject 'B' as property.\r\n```\r\nclass A : RLMObject\r\n{\r\n      @property _name:NSString;\r\n      @property _b:B;\r\n}\r\n\r\nclass B : RLMObject\r\n{\r\n      @property _a_property:int;\r\n}\r\n```\r\nI would like to filter the A objects I get from my Realm file on their embedded B object.\r\n\r\nBasically, I would like to do something like:\r\n```\r\n_name = 'Whatever Name' AND (_b != nil or _b._a_property = \"5\")\r\n```\r\nIt is similar to a joint in SQL.\r\n\r\nIt doesn't work, because obviously _b_a_property isn't the name of a property on A...but I was wondering if any one knows if there's a way to achieve that\r\n\r\nI absolutely need a RLMResults, so no need to suggest to work with RLMArray. I tried putting the objects one by one in an RLMArray, do manually my filtering on B, then calling sortedResultsUsingProperty on it, but Realm raise an exception because this RLMArray cannot do 'sortedResultsUsingProperty' on an RLMArray not returned by Realm...\r\n\r\nAny help appreciated :-)\r\n\r\nI am using Realm 0.96.3\r\n\r\nThank you,\r\n\r\nChristophe"},"comment":{"url":"https://api.github.com/repos/realm/realm-cocoa/issues/comments/217947088","html_url":"https://github.com/realm/realm-cocoa/issues/3539#issuecomment-217947088","issue_url":"https://api.github.com/repos/realm/realm-cocoa/issues/3539","id":217947088,"user":{"login":"Chris59160","id":5450122,"avatar_url":"https://avatars.githubusercontent.com/u/5450122?v=3","gravatar_id":"","url":"https://api.github.com/users/Chris59160","html_url":"https://github.com/Chris59160","followers_url":"https://api.github.com/users/Chris59160/followers","following_url":"https://api.github.com/users/Chris59160/following{/other_user}","gists_url":"https://api.github.com/users/Chris59160/gists{/gist_id}","starred_url":"https://api.github.com/users/Chris59160/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Chris59160/subscriptions","organizations_url":"https://api.github.com/users/Chris59160/orgs","repos_url":"https://api.github.com/users/Chris59160/repos","events_url":"https://api.github.com/users/Chris59160/events{/privacy}","received_events_url":"https://api.github.com/users/Chris59160/received_events","type":"User","site_admin":false},"created_at":"2016-05-09T18:25:08Z","updated_at":"2016-05-09T18:25:08Z","body":"Thanks bdash, no idea what I was doing wrong before, but I adapted to the realm property names and it works fine now...mystery, but it works fine and I was just doing something bad :/\r\n\r\nThanks for the help !!"}}