Nsclassfromstring Usage Cases
Self.tabBar.items = @[//Customer
@{@ "normal": @ "Tabbar/kehu.png",
@ "selected": @ "Tabbar/kehu_sel.png"},
Policy
@{@ "normal": @ "Tabbar/baodan.png",
@ "selected": @ "Tabbar/baodan_sel.png"},
Plan
@{@ "normal": @ "Tabbar/jihua.png",
@ "selected": @ "Tabbar/jihua_sel.png"},
Activities
@{@ "normal": @ "Tabbar/huodong.png",
@ "selected": @ "Tabbar/huodong_sel.png"},
Sales
@{@ "normal": @ "Tabbar/xiaoshou.png",
@ "selected": @ "Tabbar/xiaoshou_sel.png"}
Partner
@{@ "normal": @ "Tabbar/huoban.png",
@ "selected": @ "Tabbar/huoban_sel.png"},
Set up
@{@ "normal": @ "Tabbar/shezhi.png",
@ "selected": @ "Tabbar/shezhi_sel.png"},
News
@{@ "normal": @ "Tabbar/message.png",
@ "selected": @ "Tabbar/message_sel.png"},//Tools
Tools
@{@ "normal": @ "Tabbar/tool.png",
@ "selected": @ "Tabbar/tool_sel.png"}
];
Self.viewcontrollers = @[//Customer
[Self itemvc:@ "Tplcustomerlistcontroller"],
Policy
[Self itemvc:@ "tplpolicyinfohomecontroller_new"],
Plan
[Self itemvc:@ "Tplagendahomecontroller"],
Activities
[Self itemvc:@ "Tplcallonhomecontroller"],
Sales
[Self itemvc:@ "Tplinsuplanhomecontroller"],
Performance
[Self itemvc:@ "Tplreporthomecontroller"],
Partner
[Self itemvc:@ "Tplpartnerhomecontroller"],
Set up
[Self itemvc:@ "Tplsettinghomecontroller"],
News
[Self itemvc:@ "Tplmessagehomecontroller"],
Tools
[Self itemvc:@ "Tpltoolhomeviewcontroller"];
-(uiviewcontroller*) Itemvc: (nsstring*) ClassName {
tplviewcontroller* VC = (tplviewcontroller*) [[Nsclassfromstring (ClassName) alloc]init];
if (nil = = VC) {
return nil;
}
if (![ VC Iskindofclass:[tpltabitemviewcontroller class]) {
[NSException raise:nsinvalidargumentexception format:@ "TabItem base class must be Tpltabitemviewcontroller"];
}
Vc.navibarhidden = YES;
return [[Tplnavigationcontroller alloc] INITWITHROOTVIEWCONTROLLER:VC];
}
[Go] Miscellaneous notes