我的代码:
UIView *screen=[[UIView alloc]initWithFrame:CGRectMake(0, 0, 320, 480)];
screen.backgroundColor=[UIColor grayColor];
UIView *screen2=[[UIView alloc]initWithFrame:CGRectMake(0, 0, 320, 480)];
screen.backgroundColor=[UIColor redColor];
screen2.backgroundColor=[UIColor greenColor];
UITabBarController *tab=[[UITabBarController alloc]init];
[tab setViewControllers:[NSArray arrayWithObjects:screen,screen2, nil]];
self.view=tab.view;
但是当我运行它时出现异常: [[tab setViewControllers:[NSArray arrayWithObjects:screen,screen2, nil]];
谁能告诉我为什么?,我是初学者谢谢