Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

matthew858

macrumors member
Original poster
Apr 15, 2008
97
0
Sydney, Australia
I have an app that chooses whether or not to display a tab on a UITabBar based on the Settings application. Is there a way to read straight from the Settings bundle to modify whether or not to display my data?

At the moment, I am reading from Info.plist as follows:

Code:
NSBundle *bundle = [NSBundle mainBundle];
NSDictionary *info = [bundle infoDictionary];

if ([info boolForKey:@"showStore"] == YES)
{
	localNavigationController = [self createNavigationControllerWrappingViewControllerForDataSourceOfClass:[StoreClass class]];
	[localViewControllersArray addObject:localNavigationController];
	
	[localNavigationController release];
}

But I am having a hard time getting the Settings bundle to modify what is in Info.plist, then having the app detect whether or not to display the tab.

If it is possible, how would I go about doing it (and since I'm new to coding, do you possibly have some sample code:eek:)?
 
I haven't used the settings bundle thing before, but I think you need to use NSUserDefaults to read the values it sets in your app.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.