{"action":"created","issue":{"url":"https://api.github.com/repos/realm/realm-cocoa/issues/3912","repository_url":"https://api.github.com/repos/realm/realm-cocoa","labels_url":"https://api.github.com/repos/realm/realm-cocoa/issues/3912/labels{/name}","comments_url":"https://api.github.com/repos/realm/realm-cocoa/issues/3912/comments","events_url":"https://api.github.com/repos/realm/realm-cocoa/issues/3912/events","html_url":"https://github.com/realm/realm-cocoa/issues/3912","id":167546193,"number":3912,"title":"Can't use subclasses with RLMLinkingObjects","user":{"login":"timothycosta","id":948806,"avatar_url":"https://avatars.githubusercontent.com/u/948806?v=3","gravatar_id":"","url":"https://api.github.com/users/timothycosta","html_url":"https://github.com/timothycosta","followers_url":"https://api.github.com/users/timothycosta/followers","following_url":"https://api.github.com/users/timothycosta/following{/other_user}","gists_url":"https://api.github.com/users/timothycosta/gists{/gist_id}","starred_url":"https://api.github.com/users/timothycosta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timothycosta/subscriptions","organizations_url":"https://api.github.com/users/timothycosta/orgs","repos_url":"https://api.github.com/users/timothycosta/repos","events_url":"https://api.github.com/users/timothycosta/events{/privacy}","received_events_url":"https://api.github.com/users/timothycosta/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,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-07-26T08:12:46Z","updated_at":"2016-07-26T08:36:56Z","closed_at":null,"body":"I had been putting off updating realm due to my use of the deprecated `linkingObjectsOfClass:forProperty:` method.  Now that I've done so, my \"owners\" property is never populated due to my use of subclasses.\r\n\r\n## Goals\r\n\r\nBe able to access owning objects regardless of subclass, as was possible with `linkingObjectsOfClass:forProperty:`\r\n\r\n## Expected Results\r\n\r\nProperties of type `RLMLinkingObjects` should link to subclasses, not just specific class types.\r\n\r\n## Actual Results\r\n\r\nProperties of type `RLMLinkingObjects` contain no results when owners are a subclass unless the subclass is specifically added to `linkingObjectsProperties` with a separate property.\r\n\r\n## Steps to Reproduce\r\n\r\nCreate an \"owning\" class - `SyncableObject`\r\nCreate an \"owning\" subclass - `SyncableObjectSubclass`\r\nCreate an \"owned\" class - `SyncableProperty`\r\n\r\nCreate an RLMArray of SyncableProperties on SyncableObject\r\nCreate an RLMLinkingObjects property on SyncableProperty\r\n\r\nAdd owned SyncableProperties to SyncableObjectSubclass\r\n\r\nTry to access owning objects via RLMLinkingObjects property.  This property contains no values.\r\n\r\n## Code Sample\r\n\r\nhttps://github.com/timothycosta/RealmLinkingObjectsWithSubclasses\r\n\r\nOutput: \r\n\r\n```\r\nSub.dirtyProperties: RLMArray <0x7fed3bc95dd0> (\r\n\t[0] SyncableProperty {\r\n\t\tuuid = 52F0E33B-43B8-4D6D-96C9-2444BFB6FFD4;\r\n\t}\r\n)\r\n2016-07-26 16:50:52.523 RealmKVOCrash[70901:3204441] Prop.owners: RLMResults <0x7fed3bf084e0> (\r\n\r\n)\r\n2016-07-26 16:50:52.524 RealmKVOCrash[70901:3204441] Prop.subclassOwners: RLMResults <0x7fed3bd31e70> (\r\n\t[0] SyncableObjectSubclass {\r\n\t\tdirtyProperties = RLMArray <0x7fed3bd32590> (\r\n\t\t\t[0] SyncableProperty {\r\n\t\t\t\tuuid = 52F0E33B-43B8-4D6D-96C9-2444BFB6FFD4;\r\n\t\t\t}\r\n\t\t);\r\n\t}\r\n)\r\n\r\n```\r\n\r\n## Version of Realm and Tooling\r\n\r\nRealm version: 1.0.2\r\n\r\nXcode version: 7.3\r\n\r\niOS/OSX version: 9\r\n\r\nDependency manager + version: Cocoapods 0.39.0\r\n"},"comment":{"url":"https://api.github.com/repos/realm/realm-cocoa/issues/comments/235198648","html_url":"https://github.com/realm/realm-cocoa/issues/3912#issuecomment-235198648","issue_url":"https://api.github.com/repos/realm/realm-cocoa/issues/3912","id":235198648,"user":{"login":"ashvar","id":1983160,"avatar_url":"https://avatars.githubusercontent.com/u/1983160?v=3","gravatar_id":"","url":"https://api.github.com/users/ashvar","html_url":"https://github.com/ashvar","followers_url":"https://api.github.com/users/ashvar/followers","following_url":"https://api.github.com/users/ashvar/following{/other_user}","gists_url":"https://api.github.com/users/ashvar/gists{/gist_id}","starred_url":"https://api.github.com/users/ashvar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ashvar/subscriptions","organizations_url":"https://api.github.com/users/ashvar/orgs","repos_url":"https://api.github.com/users/ashvar/repos","events_url":"https://api.github.com/users/ashvar/events{/privacy}","received_events_url":"https://api.github.com/users/ashvar/received_events","type":"User","site_admin":false},"created_at":"2016-07-26T08:36:56Z","updated_at":"2016-07-26T08:36:56Z","body":"In my case I have RLMObjects subclasses: Item, Tag, Group. They have following relations:\r\nItem <<- Group (One to many).\r\nItem <<->> Tag (Many to many).\r\n\r\nAnd I want to further subclass them to add additional properties. Isn't it possible at all?"}}
{"actor":{"display_login":"ashvar"}}