addChildViewController alternative for iOS 4.3

前端 未结 3 674
旧时难觅i
旧时难觅i 2021-01-14 17:33

I would like to use the same functionality of addChildViewController, but for the version 4.3 (addChildViewController is only available in version 5). Thanks in advance.

3条回答
  •  情话喂你
    2021-01-14 18:18

    Something similar is explained in iOS: different addSubview behavior between iOS 4.3 and 5.0.

    I have solved it by adding these lines:

    NSMutableArray *controladores=[[NSMutableArray alloc]init];
            [controladores addObject:myController];
            if ([[[UIDevice currentDevice] systemVersion] compare:@"5.0"] == NSOrderedAscending) {
                [tabBar setViewControllers:controladores animated:YES];
            }
    

提交回复
热议问题