Mantle / MTLManagedObjectAdapter

Core Data support for Mantle
https://github.com/Mantle/Mantle
MIT License
140 stars 55 forks source link

How to avoid type mismatch problem? #9

Closed ghost closed 9 years ago

ghost commented 9 years ago

If i have a NSNumber property, and ths JSON is NSString.I map to mantle model is ok, but when I convert mantle to NSManagedObject it can't auto check or transform the value, and it crashed. How can i avoid this automatic.

jspahrsummers commented 9 years ago

You need to provide a JSON transformer to ensure that the string becomes a number before being assigned to your model object.

See the Mantle README.