I am not able to initialise a model from JSONModel. I am using JSONModel (as after this poc the .json is huge and needs a third party library like this to take care.). My steps are as follows:
- Pod installed the JSONModel
- Create a simple model that you want the .json got from the url to initialise
your model in your project. As per the description I am getting the
nil
value out of it.Analysing why I got the
nil
value, I think one might be the reason.if (!json || ![json isKindOfClass:[NSArray class]]) return nil;
here I am getting .json value, so checking this
[json isKindOfClass:[NSArray class]],
I am getting a nil
value .
In .h file of my model. I create a property of jokeid, text and in .m file I am using this code
+(JSONKeyMapper*)keyMapper{
return [[JSONKeyMapper alloc]initWithModelToJSONDictionary:@{@"jokeid":@"jokeid", @"text":@"text"}];
}
I need some guidance in this "arrayOfModelsFromData:" of JSONModel . I am posting my snapshot and the code
code is in github https://github.com/utsav475908/sdfs
Debugging snapshot is here