Get information from Info.plist

Sometimes, you may want to get the version number of your application to show it in the about page. It is bad idea to hardcode your version number in your code rather than get the correct version number from the Info.plist.

To get the version number from Info.plist, we can use the following code:

NSString *verStr = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"];

that we can also use this method to get other information from Info.plist like the bundle name, display name and bundle identifier.