#import “shouyeViewController.h”
#import “qicheViewController.h”
#import “sheuqViewController.h”
#import “zixunViewController.h”
#import “woViewController.h”
@interface ViewController ()
@end
@implementation ViewController
-
(void)viewDidLoad {
[super viewDidLoad];NSArray *array=@[@“shouyeViewController”,@“qicheViewController”,@“sheuqViewController”,@“zixunViewController”,@“woViewController”];
NSArray *arr=@[@“首页”,@“汽车报价”,@“社区”,@“资讯”,@“我的”];
NSMutableArray *mutablearray=[NSMutableArray new];
for (int i=0; i<array.count; i++) {
UIViewController *vc=[[NSClassFromString(array[i])alloc] init]; UINavigationController *nav=[[UINavigationController alloc] initWithRootViewController:vc]; nav.tabBarItem.image=[[UIImage imageNamed:arr[i]] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]; nav.title=arr[i]; nav.navigationBar.barTintColor=[UIColor orangeColor]; [mutablearray addObject:nav];}
self.viewControllers=mutablearray;
}

9416

被折叠的 条评论
为什么被折叠?



