문제

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?

도움이 되었습니까?

해결책

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

Apple's documentation

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top