Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

App Target Summary

In Xcode 4, I see this for my target summary:

The "Version" input corresponds to CFBundleShortVersionString in the info.plist file, and the "Build" input corresponds to CFBundleVersion.

What's the difference between these two? I see a lot of people on the internet wanting to put the same value in for both, and my suspicion is that is for backwards compatability.

I have two questions:

1) If I were starting from scratch, what would be the best practice for versioning your app?

2) In all previous releases of my app, I only used CFBundleVersion. In order to not mess up the upgrade process, should I continue to increment CFBundleVersion the same way I have been or is it possible to switch to the "right way", assuming one exists?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
561 views
Welcome To Ask or Share your Answers For Others

1 Answer

The Apple document "Information Property List Key Reference" says that CFBundleShortVersionString represents a release version, whereas CFBundleVersion represents any build, released or not. Also, CFBundleShortVersionString can be localized, though I don't know why you'd want to, since they say it is supposed to be "a string comprised of three period-separated integers". For a release build, it would be reasonable to make the two numbers the same. For a development build, you might tack something else on to the CFBundleVersion, maybe another dot and integer.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...