Closed coanag closed 10 years ago
OCMapper won't be able to map NSIndexPath for you. because row and sections are not properties. OCMapper can work for Objects (Model objects) that can be initialized by int method, and have properties.
You could always create a wrapper
[
{
"section" : 1,
"row" :2
},
{
"section" : 1,
"row" :2
},
{
"section" : 1,
"row" :2
}
]
@onterface IndexPath
@property(nonatomic, retain) NSNumber *row;
@property(nonatomic, retain) NSNumber *section;
@end
NSArray *indexPathList = [IndexPath objectFromDictionary:indexPathDictionary];
Then you can translate that to NSIndexPath
Great thanks, Which files from ocmapper should I import to my project?
Copy the whole source folder to your project. If you don't have Core Data referenced in your project remove these files to avoid compile errors
ManagedObjectInstanceProvider.m ManagedObjectInstanceProvider.h
I have an array and need to a need to map the indexpath.row dictionary to my preconfigured nsobject . Which files should I import to my project (from the ocmapper library)? Which the recommended method to configure the mapping? User *user = [User objectFromDictionary:aDictionary];?