IOS获取当前版本号 Bundle ID等信息的方法详解

复制代码
本人亲测有效!更多交流可以家魏鑫:lixiaowu1129,公重好:iOS过审汇总,一起探讨iOS技术!

IOS获取当前版本号 Bundle ID等信息的方法

1:获取bundle Id信息:\[NSBundle mainBundlebundleIdentifier];

2:获取版本号:\[\[NSBundle mainBundleinfoDictionary] objectForKey:@"CFBundleShortVersionString"];

3:获取build号:\[\[NSBundle mainBundleinfoDictionary] objectForKey:@"CFBundleVersion"];

4:获取App显示名:\[\[NSBundle mainBundleinfoDictionary] objectForKey:@"CFBundleDisplayName"];

其实 \[NSBundle mainBundleinfoDictionary] 获得的是一个字典,里边放着Info.plist文件中的各种信息,根据不同的键去即可,如:

objectivec 复制代码
CFBundleDevelopmentRegion 

  CFBundleDisplayName 

  CFBundleExecutable

  CFBundleExecutablePath

  CFBundleIdentifier

  CFBundleInfoDictionaryVersion = "6.0";

  CFBundleInfoPlistURL

  CFBundleName

  CFBundlePackageType 

  CFBundleShortVersionString

  CFBundleSignature 

 CFBundleSupportedPlatforms
相关推荐
茶底世界之下2 天前
为什么预览、录制、离线导出不能共享同一个背压策略?
ios·swift
2501_916007472 天前
苹果商店iOS应用上架费用全面解析:开发者计划与审核费用计算
android·ios·小程序·https·uni-app·iphone·webview
2501_916008892 天前
如何实现iOS App代码混淆:SwiftShield使用指南
android·ios·小程序·https·uni-app·iphone·webview
2501_915909062 天前
移动端开发工具链怎么组合比较好,iOS、Android、跨端三套配置方案
ide·vscode·ios·objective-c·个人开发·swift·敏捷流程
东坡肘子2 天前
一场关于 SwiftUI 动画的“原生”之争 -- 肘子的 Swift 周报 #154
人工智能·swiftui·swift
2501_916008892 天前
怎么用 Godot 导出 iOS 应用并上架 App Store?签名字段该填什么?
android·ios·小程序·https·uni-app·iphone·webview
2501_915918412 天前
iOS编程用什么软件好?主流工具Xcode、AppCode、CodeRunner与新兴快蝎对比
ide·vscode·ios·objective-c·个人开发·swift·敏捷流程
终端安全笔记3 天前
iOS 27 之后「策略空转」:设备升级不报错,但旧策略不再管它
android·网络·安全·ios·智能手机
9765033353 天前
iOS 上架 4.3a 被拒【uniapp专讲】
flutter·ios·objective-c·uniapp·swift
黑化旺仔3 天前
【OC】KVO
macos·ios·objective-c·cocoa