New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OCMapper2.1 seems not working in Xcode 5? #46
Comments
First of all your model has a property of type int, that's not supported, you should use NSNumber for numeric values and booleans similar to CoreData 1- Yes
3- OCMapper goes through the dictionary keys, and if it finds a matching property then it maps it, otherwise it'll ignore it. So yes it does support optional mapping |
@aryaxt , thanks for your reply.
Now I get:
|
Your dictionary has a string for user_id, but your property is an NSNumber But in your case you have a string as dictionary, so you either need to change that or change the property to be a string |
@aryaxt user_id should be a NSNumber , no?
If I just add user_id with NSNumber, then I get
I just tried to add String, and tried the second usage of OCmapper as well, the user_id is always null. |
@aryaxt It seems the OCMapper can;t find properly the property name for user_id in User Model. |
Hello,
I am using OCMapper in my Xcode 5 project which is under OS X 10.8.5.
I am trying the sample test as following, but the user_id is null, the object didn't get mapped I don't know why?
Here is my Model:
Here is my Test
So I have 3 questins:
1, is Xcode 5 + OS X 10.8 supported by the latest OCMapper 2.1 version?
2, I tried to use like this (I saw on StackOverflow)
User *user = [User objectFromDictionary:dic];
but this needs to add
#import "NSObject+ObjectMapper.h"
3, in case the Model has more properties than the dictionary, for exampel, we have only user_id in the dictionary while User has user_id + registration, does OCMapper support the optional mapping?
The text was updated successfully, but these errors were encountered: