{"action":"created","issue":{"url":"https://api.github.com/repos/realm/realm-cocoa/issues/2685","labels_url":"https://api.github.com/repos/realm/realm-cocoa/issues/2685/labels{/name}","comments_url":"https://api.github.com/repos/realm/realm-cocoa/issues/2685/comments","events_url":"https://api.github.com/repos/realm/realm-cocoa/issues/2685/events","html_url":"https://github.com/realm/realm-cocoa/issues/2685","id":111694370,"number":2685,"title":"Key value coding for Lists has to know the specific type","user":{"login":"tom-sparo","id":12956264,"avatar_url":"https://avatars.githubusercontent.com/u/12956264?v=3","gravatar_id":"","url":"https://api.github.com/users/tom-sparo","html_url":"https://github.com/tom-sparo","followers_url":"https://api.github.com/users/tom-sparo/followers","following_url":"https://api.github.com/users/tom-sparo/following{/other_user}","gists_url":"https://api.github.com/users/tom-sparo/gists{/gist_id}","starred_url":"https://api.github.com/users/tom-sparo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tom-sparo/subscriptions","organizations_url":"https://api.github.com/users/tom-sparo/orgs","repos_url":"https://api.github.com/users/tom-sparo/repos","events_url":"https://api.github.com/users/tom-sparo/events{/privacy}","received_events_url":"https://api.github.com/users/tom-sparo/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/realm/realm-cocoa/labels/Help","name":"Help","color":"cc317c"}],"state":"closed","locked":false,"assignee":{"login":"jpsim","id":474794,"avatar_url":"https://avatars.githubusercontent.com/u/474794?v=3","gravatar_id":"","url":"https://api.github.com/users/jpsim","html_url":"https://github.com/jpsim","followers_url":"https://api.github.com/users/jpsim/followers","following_url":"https://api.github.com/users/jpsim/following{/other_user}","gists_url":"https://api.github.com/users/jpsim/gists{/gist_id}","starred_url":"https://api.github.com/users/jpsim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpsim/subscriptions","organizations_url":"https://api.github.com/users/jpsim/orgs","repos_url":"https://api.github.com/users/jpsim/repos","events_url":"https://api.github.com/users/jpsim/events{/privacy}","received_events_url":"https://api.github.com/users/jpsim/received_events","type":"User","site_admin":false},"milestone":null,"comments":3,"created_at":"2015-10-15T19:51:52Z","updated_at":"2015-10-16T03:18:28Z","closed_at":"2015-10-16T03:18:28Z","body":"Say I have a realm object:\r\n\r\n```swift\r\nclass TestObject : Object {\r\n    let otherObjects = List<TestObject>()\r\n}\r\n```\r\n\r\nIf I want to use key value coding:\r\n```swift\r\nlet testObject = TestObject()\r\nlet aList = testObject.valueForKey(\"otherObjects\")!\r\naList is List<Object> // false\r\naList is List<TestObject> // true\r\n```\r\nI have to know the exact type of that relationship.  This makes certain reflection-based approaches sort of difficult, for instance if I want to blindly walk over an object tree performing some action.\r\n\r\nIs there a better way to get the KVC to behave, to get generics to behave, or to walk over an object tree?  I see that I can reflect on the objectSchema and get a string representation of the List'd field... but it's a String and I remember NSClassFromString being kind of a bear.  So if I could get the type in the List from the objectSchema that's another option.\r\n\r\nSorry this is sorta hacky!\r\n\r\nJust for reference, is this an effect of List<> generics?  Because with normal arrays in swift this works:\r\n\r\n```swift\r\nclass A: NSObject {}\r\n\r\nclass B: A {}\r\n\r\nclass Something: NSObject {\r\n    let array: [B] = [B(), B()]\r\n}\r\n\r\nlet arr = Something().valueForKey(\"array\")\r\narr is Array<A> // true\r\narr is Array<B> // true\r\narr is Array<Int> // false\r\n```"},"comment":{"url":"https://api.github.com/repos/realm/realm-cocoa/issues/comments/148588247","html_url":"https://github.com/realm/realm-cocoa/issues/2685#issuecomment-148588247","issue_url":"https://api.github.com/repos/realm/realm-cocoa/issues/2685","id":148588247,"user":{"login":"jpsim","id":474794,"avatar_url":"https://avatars.githubusercontent.com/u/474794?v=3","gravatar_id":"","url":"https://api.github.com/users/jpsim","html_url":"https://github.com/jpsim","followers_url":"https://api.github.com/users/jpsim/followers","following_url":"https://api.github.com/users/jpsim/following{/other_user}","gists_url":"https://api.github.com/users/jpsim/gists{/gist_id}","starred_url":"https://api.github.com/users/jpsim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpsim/subscriptions","organizations_url":"https://api.github.com/users/jpsim/orgs","repos_url":"https://api.github.com/users/jpsim/repos","events_url":"https://api.github.com/users/jpsim/events{/privacy}","received_events_url":"https://api.github.com/users/jpsim/received_events","type":"User","site_admin":false},"created_at":"2015-10-16T03:18:28Z","updated_at":"2015-10-16T03:18:28Z","body":":+1: "}}