gpt4 book ai didi

swift - 无法将类型 'NSImageInterpolation.Type' 的值转换为预期参数类型 '[NSImageRep.HintKey : Any]?'

转载 作者:行者123 更新时间:2023-12-03 17:45:59 29 4
gpt4 key购买 nike

我想按照 https://stackoverflow.com/a/14878177/848968 添加图像插值提示

 guard let representation = self.bestRepresentation(for: frame, context: nil,hints: NSImageInterpolation) else {
return nil

但我不断收到此异常

Cannot convert value of type 'NSImageInterpolation.Type' to expected argument type '[NSImageRep.HintKey : Any]?'

最佳答案

这个错误是不言自明的。

guard let representation = self.bestRepresentation(for: frame,
context: nil,
hints: [.interpolation: NSImageInterpolation.high])
else { return nil }

关于swift - 无法将类型 'NSImageInterpolation.Type' 的值转换为预期参数类型 '[NSImageRep.HintKey : Any]?',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61032371/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com