@interface Entity()
@property (assign) int searchTotalPagesAll;
@property (assign) int searchTotalPagesIdeas;
@end
@implementation Entity
+ (NSDictionary *)JSONKeyPathsByPropertyKey {
return @{
@"Id": @"entity.id_entity",
@"name": @"entity.name",
@"coverage" : @"entity.coverage",
@"id_city": @"entity.Id_City",
@"cityName":@"entity.city",
@"countryName":@"entity.country",
@"stateName":@"entity.district",
@"countryCode": @"entity.countrycode",
@"keyword1": @"entity.key1",
... etc
में डिफ़ॉल्ट मान सेट करने के लिए विरासत उदाहरण के बाद से एक init विधि नहीं है, मैं उन गुणों (searchTotalPagesAll, searchTotalPagesIdeas) मूलभूत मूल्यों के लिए जहां से प्रारंभ करना चाहिए? इस मॉडल में आंतरिक विधियां हैं जिनके लिए इसकी आवश्यकता है और कई अन्य गुण हैं।कैसे आईओएस मेंटल मॉडल उपवर्ग
अगर मैं इस तरह से प्रारंभ: [[MyMantleModelClass alloc] init] यह ट्रिगर नहीं करेगा [-initWithDictionary: त्रुटि:]। मैं पूर्व आरंभकर्ता को एक दूसरे को फोन किए बिना बाद में कॉल करने के लिए कैसे मजबूर कर सकता हूं? धन्यवाद। – Donald
यदि आप 'initWithDictionary' का उपयोग नहीं कर रहे हैं तो आप केवल' init' में संपत्ति मान सेट कर सकते हैं। –