Original address: Cfbundleshortversionstring and cfbundleversion in IOS
IOS development often see cfbundleshortversionstring and cfbundleversion Two can be used to identify the application version number of variables, which should be used. Here's a probe. cfbundleshortversionstring
Cfbundleshortversionstring (String-ios, OS X) represents the bundle release version number, which identifies a release iteration of the application. The release version number is three with a period. A string of divided integers, the first number being the major version number, representing important features or significant updates, the second number representing the update of minor functions, and the third number indicating maintenance updates, and the specific rules can refer to the semantic version.
This value differs from the value of the cfbundleversion that represents applying the build iteration, including the publication and unpublished, and this value can be included in the Infoplist.strings file for localization.
View Cfbundleshortversionstring's Apple developer documentation. cfbundleversion
Cfbundleversion (String-ios, OS X) represents the version number of the bundle build iteration (publish and unpublished), the naming rules are the same as cfbundleshortversionstring, and can only contain numbers (0-9) and periods (.) , 0 of the beginning of the integer is ignored, for example: 1.02.3 is the same as 1.2.3. This value cannot be localized.
View Cfbundleversion's Apple developer documentation.
The comparison between the two values is as follows:
Key |
Xcode name |
Summary |
Cfbundleshortversionstring |
Bundle versions string, short |
(localizable) The Release-version-number string for the bundle |
Cfbundleversion |
Bundle version |
(recommended) The Build-version-number string for the bundle |
In simple terms, the cfbundleshortversionstring identifies the bundle version number string and can be localized, while Cfbundleversion represents the build version number, so it is recommended that cfbundleversion be used as the version of the application Number identification.