我以编程方式获取应用程序版本并获取应用程序版本的空白值。我的内部版本号也为0-kCFBundleVersionKey。下面是相同的代码。NSString*version=[[NSBundlemainBundle]objectForInfoDictionaryKey:@"CFBundleShortVersionString"];NSString*build=[[NSBundlemainBundle]objectForInfoDictionaryKey:(NSString*)kCFBundleVersionKey];我已经在info.plist文件和目标的常规选项卡中添加了值。
“信息词典版本”是什么意思?肯定和bundle版本不一样,但是“InfoDictionary版本”的作用是什么? 最佳答案 “InfoDictionary版本”表示Info.plist格式的版本信息。参见Apple'sdocforCFBundleInfoDictionaryVersion了解详情。CFBundleInfoDictionaryVersion(String-iOS,macOS)identifiesthecurrentversionofthepropertyliststructure.Thiskeyexiststosupp
“信息词典版本”是什么意思?肯定和bundle版本不一样,但是“InfoDictionary版本”的作用是什么? 最佳答案 “InfoDictionary版本”表示Info.plist格式的版本信息。参见Apple'sdocforCFBundleInfoDictionaryVersion了解详情。CFBundleInfoDictionaryVersion(String-iOS,macOS)identifiesthecurrentversionofthepropertyliststructure.Thiskeyexiststosupp
如何在Swift中获取应用程序名称?谷歌搜索给了我这个:[[[NSBundlemainBundle]infoDictionary]objectForKey:@"CFBundleName"];我将它转换为Swift;错误-方法不存在:NSBundle.mainBundle().infoDictionary.objectForKey("CFBundleName") 最佳答案 这应该有效:NSBundle.mainBundle().infoDictionary!["CFBundleName"]as!StringinfoDictionary
如何在Swift中获取应用程序名称?谷歌搜索给了我这个:[[[NSBundlemainBundle]infoDictionary]objectForKey:@"CFBundleName"];我将它转换为Swift;错误-方法不存在:NSBundle.mainBundle().infoDictionary.objectForKey("CFBundleName") 最佳答案 这应该有效:NSBundle.mainBundle().infoDictionary!["CFBundleName"]as!StringinfoDictionary