1

Currently, I have a custom user defined build settings in which I set the DISPLAY_NAME.

Then, in the General tab of Build Settings, in the display name column, I fetch this value as $(DISPLAY_NAME) from my user defined build settings.

I want to instead read the Display Name and set the general build settings from my Info.plist file. How can I do this?

Zee
  • 1,865
  • 21
  • 42
entropy.maximum
  • 477
  • 4
  • 16

1 Answers1

3

you can use the following code.

Read info.plist file.

NSDictionary *infoDict = [[NSBundle mainBundle] infoDictionary];
NSString *value = [infoDict objectForKey:@"keyName"];

infoDictionary: A dictionary, constructed from the bundle's Info.plist file, that contains information about the receiver.

Read a custom .plist file

   NSString *file = [[NSBundle bundleForClass:[self class]] pathForResource:"nameOfPlist" ofType:@"plist"];

    if (!file) {
        NSLog(@"Please add a plist config file to your project.");
        return nil;
    }

    NSDictionary *plistDict =  [NSDictionary dictionaryWithContentsOfFile:file];
Kumar Reddy
  • 792
  • 6
  • 15