As I describe here, I use a script to rewrite a header file with my current Subversion revision number. That revision number is stored in the kRevisionNumber constant. I can then access the version and revision number using something similar to the following:
[NSString stringWithFormat:@"Version %@ (%@)", [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"], kRevisionNumber]
which will create a string of the format "Version 1.0 (51)".
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…