{"action":"created","issue":{"url":"https://api.github.com/repos/Mantle/Mantle/issues/491","labels_url":"https://api.github.com/repos/Mantle/Mantle/issues/491/labels{/name}","comments_url":"https://api.github.com/repos/Mantle/Mantle/issues/491/comments","events_url":"https://api.github.com/repos/Mantle/Mantle/issues/491/events","html_url":"https://github.com/Mantle/Mantle/issues/491","id":67854776,"number":491,"title":"Implementing MTLModel shows error parsing JSON dictionary","user":{"login":"quantumpotato","id":433852,"avatar_url":"https://avatars.githubusercontent.com/u/433852?v=3","gravatar_id":"","url":"https://api.github.com/users/quantumpotato","html_url":"https://github.com/quantumpotato","followers_url":"https://api.github.com/users/quantumpotato/followers","following_url":"https://api.github.com/users/quantumpotato/following{/other_user}","gists_url":"https://api.github.com/users/quantumpotato/gists{/gist_id}","starred_url":"https://api.github.com/users/quantumpotato/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quantumpotato/subscriptions","organizations_url":"https://api.github.com/users/quantumpotato/orgs","repos_url":"https://api.github.com/users/quantumpotato/repos","events_url":"https://api.github.com/users/quantumpotato/events{/privacy}","received_events_url":"https://api.github.com/users/quantumpotato/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-04-12T01:08:17Z","updated_at":"2015-04-12T12:52:26Z","closed_at":null,"body":"     *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<Channel 0x7fb34b5d1420> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key user.'\r\n            \r\n                NSDictionary *json = @{@\"u1\" : @{@\"handle\" : @\"h1\", @\"authToken\" : @\"123\"}};\r\n                NSError *e = nil;\r\n                Channel *c = [[Channel alloc] initWithDictionary:json error:&e];\r\n                NSLog(@\"channel.u1.handle: %@\", c.u1.handle);\r\n            \r\n            Channel.m:\r\n            \r\n                + (NSDictionary *)JSONKeyPathsByPropertyKey {\r\n                    return @{\r\n                             @\"u1\" : @\"u1\"\r\n                             };\r\n                }\r\n                \r\n        + (NSValueTransformer *)u1Transformer {\r\n            return [MTLJSONAdapter dictionaryTransformerWithModelClass:[User class]];\r\n        }\r\n    \r\n        \r\n        User.m:\r\n        \r\n        + (NSDictionary *)JSONKeyPathsByPropertyKey {\r\n            return @{\r\n                     @\"handle\" : @\"handle\",\r\n                     @\"authToken\" : @\"token\"\r\n                     };\r\n        }\r\n    \r\n    \r\n    Using [Mantle, iOS json parsing framework][1].\r\n    \r\n    How do I parse my JSON into cocoa objects?\r\n    \r\n    \r\n      [1]: https://github.com/Mantle/Mantle\r\n\r\nfrom http://stackoverflow.com/questions/29572536/implementing-mtlmodel-shows-error-parsing-json-dictionary"},"comment":{"url":"https://api.github.com/repos/Mantle/Mantle/issues/comments/92055662","html_url":"https://github.com/Mantle/Mantle/issues/491#issuecomment-92055662","issue_url":"https://api.github.com/repos/Mantle/Mantle/issues/491","id":92055662,"user":{"login":"robb","id":212465,"avatar_url":"https://avatars.githubusercontent.com/u/212465?v=3","gravatar_id":"","url":"https://api.github.com/users/robb","html_url":"https://github.com/robb","followers_url":"https://api.github.com/users/robb/followers","following_url":"https://api.github.com/users/robb/following{/other_user}","gists_url":"https://api.github.com/users/robb/gists{/gist_id}","starred_url":"https://api.github.com/users/robb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robb/subscriptions","organizations_url":"https://api.github.com/users/robb/orgs","repos_url":"https://api.github.com/users/robb/repos","events_url":"https://api.github.com/users/robb/events{/privacy}","received_events_url":"https://api.github.com/users/robb/received_events","type":"User","site_admin":false},"created_at":"2015-04-12T12:52:26Z","updated_at":"2015-04-12T12:52:26Z","body":"Oh, nevermind. You need to use `MTLJSONAdapter` to create your model, *not* `-initWithDictionary:error:` as you are doing in:\r\n\r\n```objc\r\n[[Channel alloc] initWithDictionary:json error:&e];\r\n```"}}