{"action":"created","issue":{"url":"https://api.github.com/repos/Mantle/Mantle/issues/650","labels_url":"https://api.github.com/repos/Mantle/Mantle/issues/650/labels{/name}","comments_url":"https://api.github.com/repos/Mantle/Mantle/issues/650/comments","events_url":"https://api.github.com/repos/Mantle/Mantle/issues/650/events","html_url":"https://github.com/Mantle/Mantle/issues/650","id":118616254,"number":650,"title":"2.0.5 Update: MTLJSONAdapter suddenly failing on custom valueTransformers which previously never failed","user":{"login":"opfeffer","id":1138127,"avatar_url":"https://avatars.githubusercontent.com/u/1138127?v=3","gravatar_id":"","url":"https://api.github.com/users/opfeffer","html_url":"https://github.com/opfeffer","followers_url":"https://api.github.com/users/opfeffer/followers","following_url":"https://api.github.com/users/opfeffer/following{/other_user}","gists_url":"https://api.github.com/users/opfeffer/gists{/gist_id}","starred_url":"https://api.github.com/users/opfeffer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opfeffer/subscriptions","organizations_url":"https://api.github.com/users/opfeffer/orgs","repos_url":"https://api.github.com/users/opfeffer/repos","events_url":"https://api.github.com/users/opfeffer/events{/privacy}","received_events_url":"https://api.github.com/users/opfeffer/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-24T14:09:17Z","updated_at":"2015-12-03T22:30:47Z","closed_at":null,"body":"I updated Mantle from 2.0 to 2.0.5 because we were seeing compilation problems with Xcode7.1 (with 2.0.3 Xcode was complaining about [MTLJSONAdapter.h:212](https://github.com/Mantle/Mantle/blob/2.0/Mantle/MTLJSONAdapter.h#L212)\r\n\r\nSuddenly many of our unit tests are failing and upon digging in, I noticed that many of my custom property `*JSONValueTransformers` are failing with the following NSError\r\n\r\n     Error Domain=MTLTransformerErrorHandlingErrorDomain Code=1 \"Value did not match expected type\" UserInfo=0x791952b0 {NSLocalizedFailureReason=Expected {\r\n         v1 =     {\r\n         };\r\n     } to be of class NSMutableDictionary but got __NSDictionaryI, MTLTransformerErrorHandlingInputValueErrorKey={\r\n         v1 =     {\r\n         };\r\n     }, NSLocalizedDescription=Value did not match expected type}\r\n\r\n\r\nMy model object is pretty basic:\r\n\r\n     // Model.h\r\n     @property (nonatomic, strong) NSMutableDictionary *device;\r\n\r\n     // Model.m\r\n     + (NSDictionary *)JSONKeyPathsByPropertyKey\r\n     {\r\n         return @{\r\n                  @\"device\":@\"device\",\r\n                  };\r\n     }\r\n\r\n     + (NSValueTransformer *)deviceJSONTransformer\r\n     {\r\n         return [MTLValueTransformer transformerUsingForwardBlock:^(NSMutableDictionary *contents, BOOL *success, NSError *__autoreleasing *error) {\r\n             return [[NSMutableDictionary alloc] initWithDictionary:contents[@\"v1\"] copyItems:YES];\r\n         } reverseBlock:^(NSMutableDictionary *contents, BOOL *success, NSError *__autoreleasing *error) {\r\n             return @{ @\"v1\": contents };\r\n         }];\r\n     }\r\n\r\n\r\nPossibly related to https://github.com/Mantle/Mantle/issues/614 ."},"comment":{"url":"https://api.github.com/repos/Mantle/Mantle/issues/comments/161808333","html_url":"https://github.com/Mantle/Mantle/issues/650#issuecomment-161808333","issue_url":"https://api.github.com/repos/Mantle/Mantle/issues/650","id":161808333,"user":{"login":"betzerra","id":681600,"avatar_url":"https://avatars.githubusercontent.com/u/681600?v=3","gravatar_id":"","url":"https://api.github.com/users/betzerra","html_url":"https://github.com/betzerra","followers_url":"https://api.github.com/users/betzerra/followers","following_url":"https://api.github.com/users/betzerra/following{/other_user}","gists_url":"https://api.github.com/users/betzerra/gists{/gist_id}","starred_url":"https://api.github.com/users/betzerra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/betzerra/subscriptions","organizations_url":"https://api.github.com/users/betzerra/orgs","repos_url":"https://api.github.com/users/betzerra/repos","events_url":"https://api.github.com/users/betzerra/events{/privacy}","received_events_url":"https://api.github.com/users/betzerra/received_events","type":"User","site_admin":false},"created_at":"2015-12-03T22:30:47Z","updated_at":"2015-12-03T22:30:47Z","body":"Yup, having a similar issue with this transformer:\r\n\r\n```ObjC\r\n+ (NSValueTransformer *)dateOfBirthJSONTransformer {\r\n    return [MTLValueTransformer transformerUsingForwardBlock:^id(id value, BOOL *success, NSError *__autoreleasing *error) {\r\n        return [[NSDate ISODateFormatter] dateFromString:value];\r\n    } reverseBlock:^id(id value, BOOL *success, NSError *__autoreleasing *error) {\r\n        return [[NSDate ISODateFormatter] stringFromDate:value];\r\n    }];\r\n}\r\n```\r\n\r\nMy colleague changed Mantle version to 2.0.2 and seems stable.\r\n\r\nI don't know if it helps but I debugged for a while and I noticed that after this point, the value returns nil.\r\nhttps://github.com/Mantle/Mantle/blob/master/Mantle/MTLValueTransformer.m#L70-L80"}}