Oct 8, 2008

(iPhone) How to get ${PRODUCT_NAME} value

${PRODUCT_NAME} presents as its name, it was defined in the info.plist, it is used for "Bundle display name", ''Bundle identifier", "Bundle name", and its default value is the project name. But you can change it using xcodebuild or XCode, how can we get its value in the code, here is an example:

NSDictionary *infoPList = [[NSBundle mainBundle] infoDictionary];
NSString *appName = [infoPList objectForKey:@"CFBundleDisplayName"];

appName is the value of "Bundle display name".

No comments: