I want to read the bundle version info from Info.plist into my code, preferably as a string. How can I do this?
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- back button text does not change
相关文章
- 现在使用swift开发ios应用好还是swift?
- Could I create “Call” button in HTML 5 IPhone appl
- TCC __TCCAccessRequest_block_invoke
- xcode 4 garbage collection removed?
- Xcode: Is there a way to change line spacing (UI L
- Unable to process app at this time due to a genera
- How can I add media attachments to my push notific
- Popover segue to static cell UITableView causes co
I know that some time has passed since the quest and the answer.
Since iOS8 the accepted answer might not work.
This is the new way to do it now:
Now in iOS 8 both fields are necessary. Earlier it works without the
CFBundleShortVersionString
. But now it is a required plist field to submit any app in app store. AndkCFBundleVersionKey
is compared for uploading every new build, which must be in incremental order. Specially for TestFlight builds. I do it this way,Swift 3:
You can read your Info.plist as a dictionary with
And you can easily get the version at the
CFBundleVersion
key that way.Finally, you can get the version with
for Swift users:
for Swift3 users: