看代碼的時候看到一句,用於獲取.plist文件的版本號
labelVersion.text = [NSString stringWithFormat:@"v%@", [[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString*)kCFBundleVersionKey]];
比較感興趣的是後面的參數 kcFBundleVersionKey ,竟然是CFBundle.h已經定於好的屬性,下面有這個屬性的注釋
const CFStringRef kCFBundleVersionKey;
/* The version number of the bundle. For Mac OS 9 style version numbers (for example "2.5.3d5"), */
/* clients can use CFBundleGetVersionNumber() instead of accessing this key directly since that */
/* function will properly convert the version string into its compact integer representation. */
還有好多是kcFXXX開頭的Standard Info.plist keys 屬性,有興趣可以自己看一下CFBundle.h,研究一下它們的用法,