Hi,
I want to save the order of UITabBarController's tabs.
I used this code and got 2 warnings.
What should I do?
Edit:
Here are the warnings:
Thanks!
I want to save the order of UITabBarController's tabs.
I used this code and got 2 warnings.
What should I do?
Code:
- (void)applicationDidFinishLaunching:(UIApplication *)application {
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSInteger tabsOrder = [defaults integerForKey:kCustomizedTabs];
self.rootController.customizableViewControllers = tabsOrder;
}
- (void)applicationWillTerminate:(UIApplication *)application {
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSInteger tabsOrder = self.rootController.customizableViewControllers;
[defaults setInteger:tabsOrder forKey:kCustomizedTabs];
}
Edit:
Here are the warnings:
Code:
passing argument 1 of 'setCustomizableViewControllers:' makes pointer from integer without a cast
self.rootController.customizableViewControllers = tabsOrder;
initialization makes integer from pointer without a cast
NSInteger tabsOrder = self.rootController.customizableViewControllers;
Thanks!