我正在尝试将我的应用程序从 8 升级到 Xcode 9.3.1 并出现以下错误:
在“id<NSCopying>”类型的对象上找不到读取字典元素的预期方法
我的代码是:
// Normalize the blending mode to use for the key.
// *** Error on next three lines ***
id src = (options[CCBlendFuncSrcColor] ?: @(GL_ONE));
id dst = (options[CCBlendFuncDstColor] ?: @(GL_ZERO));
id equation = (options[CCBlendEquationColor] ?: @(GL_FUNC_ADD));
NSDictionary *normalized = @{
CCBlendFuncSrcColor: src,
CCBlendFuncDstColor: dst,
CCBlendEquationColor: equation,
// Assume they meant non-separate blending if they didn't fill in the keys.
// *** Error on next line ***
CCBlendFuncSrcAlpha: (options[CCBlendFuncSrcAlpha] ?: src),
CCBlendFuncDstAlpha: (options[CCBlendFuncDstAlpha] ?: dst),
CCBlendEquationAlpha: (options[CCBlendEquationAlpha] ?: equation),
};
谁能指出我正确的方向?我已将代码中的错误加粗。