Reading Straight From the Settings Bundle

Discussion in 'iOS Programming' started by matthew858, Apr 12, 2009.

  1. macrumors member

    Apr 15, 2008
    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:

    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:)?
  2. Moderator emeritus


    Jun 15, 2000
    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.

Share This Page