Handle a More Navigation Controller in an Interface Builder based TabBar Application
I'm still not clear on how and when to use interface builder. I have a tabbar-based application, in which I added 6 navigations controllers. Instead of having 6 tabs, I would like 3开发者_Python百科 plus a "More" tab which allows the user to configure the tabs he wants.
Is there any way to do that with IB ? And if not, how can I move from IB to a code-based tabbar (provided I already set up a class TabBarController which handles shouldAutoRotate:)
Thanks in advance !
I solved my problem. Since I already had the Class Identity specified to TabBarController
in IB for my Tab Bar Controller, i added this :
NSMutableArray *customizeable = [[NSMutableArray alloc] init];
for (id controller in tabBarController.customizableViewControllers)
{
if ([controller isKindOfClass: [MyCustomizeable class]])
[customizeable addObject:controller];
}
tabBarController.customizableViewControllers = customizeable;
[customizeable release];
just bellow :
[window addSubview:tabBarController.view];
in my ApplicationDelegate
thanks to http://www.mactech.com/articles/mactech/Vol.25/25.03/iPhoneProductivityApplicationsPart1/
note that I could had this work with just these lines :
NSMutableArray *customizeable = [[NSMutableArray alloc] init];
tabBarController.customizableViewControllers = customizeable;
[customizeable release];
But I wanted to control which tabs can be reorded
精彩评论