我正在开发app,我在其中创建了包含五个标签项的自定义标签栏。对于所有五个标签项,我使用了相同的UIViewController。单击选项卡项,我只需更改数据并刷新UIView。这是我的代码:
UIViewController* viewController = [[WallViewController alloc] init];
UIViewController* viewController1 = [[WallViewController alloc] init];
UIViewController* viewController2 = [[WallViewController alloc] init];
UIViewController* viewController3 = [[WallViewController alloc] init];
UIViewController* viewController4 = [[WallViewController alloc] init];
//set viewcontrollers in tabbar
self.viewControllers = [NSArray arrayWithObjects:
[self viewControllerWithTabTitle:@"All" image:[UIImage imageNamed:@"all.png"] delegate:viewController],
[self viewControllerWithTabTitle:@"Beta" image:[UIImage imageNamed:@"timing.png"] delegate:viewController1],
[self viewControllerWithTabTitle:@"Mix" image:nil delegate:viewController2],
[self viewControllerWithTabTitle:@"Alpha" image:[UIImage imageNamed:@"venue.png"] delegate:viewController3],
[self viewControllerWithTabTitle:@"Test" image:[UIImage imageNamed:@"rsvp.png"] delegate:viewController4], nil];
它工作得很好,但我在Objective-c ARC中转换了我的代码。现在这段代码没有用,所以我该怎么做才能解决这个问题?
提前谢谢。