Monday, 9 September 2013

Variables in a custom plist file

Variables in a custom plist file

I know it's possible to store variables in the default Info.plist file by
preprocessing the Info.plist file. I'm wondering if it's possible to do
something similar with a custom plist file.
I load the plist file via the following code:
NSString *path = [[NSBundle mainBundle] bundlePath];
NSString *customPlistPath = [path
stringByAppendingPathComponent:@"custom.plist"];
NSDictionary *plistData = [NSDictionary
dictionaryWithContentsOfFile:customPlistPath];
Is it possible to put in values like ${PRODUCT_NAME} or
${MY_OWN_VARIABLE_NAME} and have them honored in the custom plist file
after I read it in? Currently, the variable values aren't being
substituted when I read the custom plist file into an NSDictionary

No comments:

Post a Comment