IOS獲取當前版本號 Bundle ID等信息的方法詳解
IOS獲取當前版本號 Bundle ID等信息的方法
1:獲取bundle Id信息:[[NSBundle mainBundle]bundleIdentifier];
2:獲取版本號:[[[NSBundle mainBundle]infoDictionary] objectForKey:@"CFBundleShortVersionString"];
3:獲取build號:[[[NSBundle mainBundle]infoDictionary] objectForKey:@"CFBundleVersion"];
4:獲取App顯示名:[[[NSBundle mainBundle]infoDictionary] objectForKey:@"CFBundleDisplayName"];
其實 [[NSBundle mainBundle]infoDictionary] 獲得的是一個字典,里邊放著Info.plist文件中的各種信息,根據(jù)不同的鍵去即可,如:
CFBundleDevelopmentRegion CFBundleDisplayName CFBundleExecutable CFBundleExecutablePath CFBundleIdentifier CFBundleInfoDictionaryVersion = "6.0"; CFBundleInfoPlistURL CFBundleName CFBundlePackageType CFBundleShortVersionString CFBundleSignature CFBundleSupportedPlatforms
感謝閱讀,希望能幫助到大家,謝謝大家對本站的 支持!
相關文章
iOS App使用SQLite之句柄的定義及數(shù)據(jù)庫的基本操作
SQLite中在定義過句柄之后就可以指向數(shù)據(jù)庫,從而利用iOS應用程序進行打開或關閉等各種操作,這里我們就來看一下iOS App使用SQLite之句柄的定義及數(shù)據(jù)庫的基本操作2016-06-06