As futureelite7 said, that is the way to go. If you need help, this is how we do it:
- (void) tabBarController:(UITabBarController *)tabBarCtroller
didEndCustomizingViewControllers:(NSArray *)viewControllers
changed:(BOOL)changed {
NSUInteger count = tabBarCtroller.viewControllers.count;
NSMutableArray *tabOrderArray = [[NSMutableArray alloc] initWithCapacity:count];
for (UIViewController *viewController in viewControllers) {
NSInteger tag = viewController.tabBarItem.tag;
[tabOrderArray addObject:[NSNumber numberWithInteger:tag]];
}
[[NSUserDefaults standardUserDefaults] setObject:tabOrderArray forKey:@"savedTabOrder"];
[[NSUserDefaults standardUserDefaults] synchronize];
[tabOrderArray release];
}
And in your applicationDidFinishLaunching
NSArray *initialViewControllers =
[NSArray arrayWithArray:self.tabBarController.viewControllers];
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSArray *tabBarOrder = [defaults arrayForKey:@"savedTabOrder"];
if (tabBarOrder) {
NSMutableArray *newViewControllers =
[NSMutableArray arrayWithCapacity:initialViewControllers.count];
for (NSNumber *tabBarNumber in tabBarOrder) {
NSUInteger tabBarIndex = [tabBarNumber unsignedIntegerValue];
[newViewControllers addObject:[initialViewControllers objectAtIndex:tabBarIndex]];
}
self.tabBarController.viewControllers = newViewControllers;
}