Reply to comment

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.

Reply

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You can use Markdown syntax to format and style the text. Also see Markdown Extra for tables, footnotes, and more.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.