How to set NSInteger property in model
SayHelloToWorld opened this issue · comments
Do_it_now_! commented
Hi, I have a problem using NSInteger, it seems that the support for int is limited.
My model here:
@interface Feed : MTLModel <MTLJSONSerializing>
@property (assign, nonatomic, readonly) NSInteger likes;
@property (strong, nonatomic, readonly) NSString *imageURL;
@end
And the blocks in method transformerUsingForwardBlock is id input and id output, but NSInteger is a Primitive type, How should I transform this NSInteger?
Robb Böhnke commented
Mantle uses Key Value Coding, using NSNumber
for the likes
property should do the trick, you can find more in the Representing Non-Object Values section of the Key-Value Coding Programming Guide.
Feel free to reopen this if you have further questions.