简体   繁体   English

MacOS X是否相当于VerQueryValue?

[英]MacOS X equivalent for VerQueryValue?

I am currently porting a project to MacOS, and in the Windows version we use VerQueryLang(...) , which is part of winapi, to determine some file version information for the window title. 我目前正在将项目移植到MacOS,在Windows版本中,我们使用WinQuery的一部分VerQueryLang(...)来确定窗口标题的某些文件版本信息。

Is there an equivalent function on MacOS? MacOS上有等效功能吗?

Yes, it's built into the app's bundle: 是的,它内置在应用程序的捆绑包中:

NSBundle *mainBundle = [NSBundle mainBundle];
NSString *version = [mainBundle objectForInfoDictionaryKey:@"CFBundleShortVersionString"];
NSString *build = [mainBundle objectForInfoDictionaryKey:@"CFBundleVersion"];

Reference . 参考

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM