model layer data in TableView
first, if the form in the plist file:nsarray-> nsdictionary->nsarray
the outermost dictionary+ (Instancetype) Cargroupswithdict: (nsdictionary*) dict
{
return [[ SelfAlloc]initwithdict:d ICT];
}
- (Instancetype) Initwithdict: (nsdictionary*) dict
{
Self = [SuperInit];
[ SelfSetValue:d ict[@ "title"]Forkey:@ "title"];
Self.cargroups= [SuncarCarswitharray:d ict[@ "Cars"]];
return Self;
}
+ (Nsarray*) cargroups
{
Nsarray *array = [NsarrayArraywithcontentsoffile:[[NSBundleMainbundle]Pathforresource:@ "Cars_total.plist"OfType:Nil]];
Nsmutablearray *arraym = [NsmutablearrayArray];
for (nsdictionary*dict inch Array) {
[Arraym AddObject:[ Selfcargroupswithdict:D ICT]];
}
return Arraym;
}
The innermost array+ (Instancetype) Carwithdict: (nsdictionary*) dict
{
return [[ SelfAlloc]initwithdict:d ICT];
}
- (Instancetype) Initwithdict: (nsdictionary*) dict
{
Self = [SuperInit];
[ Selfsetvaluesforkeyswithdictionary:d ICT];
return Self;
}
+ (Nsarray*) Carswitharray: (Nsarray*) array
{
Nsmutablearray *arraym = [NsmutablearrayArray];
for (nsdictionary*dict inch Array) {
[Arraym AddObject:[ Selfcarwithdict:D ICT]];
}
return Arraym;
}
Second,if the form in the plist file:nsarray-> nsdictionary+ (Instancetype) Tgwithdict: (nsdictionary*) dict
{
return [[ SelfAlloc]initwithdict:d ICT];
}
- (Instancetype) Initwithdict: (nsdictionary*) dict
{
Self = [SuperInit];
if ( Self) {
[ Selfsetvaluesforkeyswithdictionary:d ICT];
}
return Self;
}
+ (Nsmutablearray*) TGS
{
Nsarray *array = [NsarrayArraywithcontentsoffile:[[NSBundleMainbundle]Pathforresource:@ "Tgs.plist"OfType:Nil]];
Nsmutablearray *arraym = [NsmutablearrayArray];
for (nsdictionary*dict inch Array) {
[Arraym AddObject:[ Selftgwithdict:D ICT]];
}
return Arraym;
}
Model layer data in TableView