Xcode Gettings Version & Build Number
Asked Answered
O

1

6

I want to print both the version and build number into my app on the app's Info and Credits screen. I've entered 1.2 in the "Version Number" on the summary page, and "D03" into the "Build Number" on summary page.

I then found this code snippet to print them,

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

However this only seems to print the value in "Build Number" not the value in version number. How do I access both the Build and Version numbers?

Odonto answered 30/12, 2012 at 3:44 Comment(2)
developer.apple.com/library/mac/#documentation/General/…Boaten
Thanks. Post as an answer and I'll mark it as correctOdonto
B
7

I believe what you want to use is CFBundleShortVersionString. Here is the documentation on what you are looking for:

Apple's documentation

Boaten answered 30/12, 2012 at 3:54 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.