【问题标题】:Alternative API s for resources 'CurResfile', 'UseResFile', etc. which have been deprecated after macOS 10.8 (Mountain Lion)macOS 10.8 (Mountain Lion) 之后已弃用的资源 'CurResfile'、'UseResFile' 等的替代 API
【发布时间】:2019-05-21 14:25:52
【问题描述】:

我需要修改使用 Carbon API 的旧代码,因为在 Mac OS X v10.8(Mountain Lion)之后不推荐使用 Carbon API。我一直在寻找资源 API 的替代品,例如 CurResfile、UseResFile、Get1Resource、FsCreateResFile、FsOpenResFile 等。

我阅读了 Apple 文档,发现我可以使用 bundle 代替这个。但是 bundle 包含不同类型的文件,资源就是其中之一。如何获取当前通过 CurResfile 获取的资源文件?

short sCurRes = CurResFile();
UseResFile(sCurRes);

【问题讨论】:

    标签: macos resources deprecated nsbundle macos-carbon


    【解决方案1】:

    这些 API 没有直接替代品。资源管理器作为一个概念,在 Mac OS X 的大部分生命周期中已经过时了——它作为一种过渡技术提供给在早期版本的 Mac OS 中使用它的应用程序。这种转变发生在 15 多年前,您的应用程序已经过去了。

    将应用程序的资产从资源中移出并放入应用程序包中的单个文件中。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-07-17
      • 1970-01-01
      • 2012-09-12
      • 2012-10-13
      • 2016-09-05
      • 2013-06-17
      • 2019-10-12
      • 1970-01-01
      相关资源
      最近更新 更多