I have a JSONModel class in Objective-C. I am initializing this with JSON returned by a server.
#import "JSONModel.h"
@protocol MyJsonMoodelClass
@end
@interface MyJsonMoodelClass : JSONModel
@property (nonatomic, strong) NSNumber <Optional> * idFilm;
This JSON contains a variable called idFilm
, and sometimes is returned of type NSNumber
but another is returned in array.
For exaple:
idFilm : 5
or
idFilm : [2, 5]
How could I control this and how could I have the same variable defined by two types, NSNumber
and NSArray
? Is possible control this?
if you override "set" method? something like this:
I don't know if can work but can be a starting point