Getting the version number from Info.plist in your code

If you are a lazy coder like me (or you don’t like to code version numbers all over the place) you should use the version number that Apple wants you to specify (in the Info.plist file) whenever you need to display a version number.

A neat macro for that would be:

#define VERSION   [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"] 


Now if anyone can figure out how to generate a build number and get that in a macro, it would be even better

Tagged with: , ,
Posted in Code

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Categories
%d bloggers like this: