{"action":"created","issue":{"url":"https://api.github.com/repos/Mantle/Mantle/issues/514","labels_url":"https://api.github.com/repos/Mantle/Mantle/issues/514/labels{/name}","comments_url":"https://api.github.com/repos/Mantle/Mantle/issues/514/comments","events_url":"https://api.github.com/repos/Mantle/Mantle/issues/514/events","html_url":"https://github.com/Mantle/Mantle/issues/514","id":74156911,"number":514,"title":"Proper way to instantiate a new instance of a MTLModel subclass","user":{"login":"dwsjoquist","id":130906,"avatar_url":"https://avatars.githubusercontent.com/u/130906?v=3","gravatar_id":"","url":"https://api.github.com/users/dwsjoquist","html_url":"https://github.com/dwsjoquist","followers_url":"https://api.github.com/users/dwsjoquist/followers","following_url":"https://api.github.com/users/dwsjoquist/following{/other_user}","gists_url":"https://api.github.com/users/dwsjoquist/gists{/gist_id}","starred_url":"https://api.github.com/users/dwsjoquist/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dwsjoquist/subscriptions","organizations_url":"https://api.github.com/users/dwsjoquist/orgs","repos_url":"https://api.github.com/users/dwsjoquist/repos","events_url":"https://api.github.com/users/dwsjoquist/events{/privacy}","received_events_url":"https://api.github.com/users/dwsjoquist/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-07T23:06:06Z","updated_at":"2015-05-07T23:21:45Z","closed_at":null,"body":"Given a class like this:\r\n    @interface MyModel : MTLModel<MTLJSONSerializing>\r\n\r\nis this the proper way to instantiate a new instance?\r\n\r\n    MyModel *instance = [MTLJSONAdapter modelOfClass:[MyModel class] fromJSONDictionary:json error:&error];\r\n\r\nI would have expected something like the following, but it does not work. It builds and runs, but most of the Mantle magic is ignored, so things like \"xyzzyJSONTransformer\" methods are not called. (They are called in the above usage.)\r\n\r\n    MyModel *instance = [[MyModel alloc] initWithDictionary:json error:&error];\r\n"},"comment":{"url":"https://api.github.com/repos/Mantle/Mantle/issues/comments/100045424","html_url":"https://github.com/Mantle/Mantle/issues/514#issuecomment-100045424","issue_url":"https://api.github.com/repos/Mantle/Mantle/issues/514","id":100045424,"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-05-07T23:21:45Z","updated_at":"2015-05-07T23:21:45Z","body":"```objc\r\nMyModel *instance = [MTLJSONAdapter modelOfClass:[MyModel class] fromJSONDictionary:json error:&error];\r\n```\r\n\r\nis the proper way to deserialize a Mantle model from a JSON dictionary, yeah.\r\n\r\n```objc\r\nMyModel *instance = [[MyModel alloc] initWithDictionary:json error:&error];\r\n```\r\n\r\non the other hand initializes a Mantle model from a dictionary (*not JSON*) representation."}}