Xcode11beta3不再接受此代码来实例化UIAction:
let action = UIAction(__title: "title", image: someImage, options: []) { _ in
// some action
}documentation中也没有任何内容。
我发现a post on Apple Developer Forums描述了同样的问题和现在被接受的语法,但它导致了运行时错误:
let action = UIAction(__title: "title", image: someImage, identifier: nil, handler: { _ in
// some action
}+[UIAction actionWithTitle:image:identifier:handler:]: unrecognized selector sent to class 0x7fffa1b30178
还有一个新参数identifier,但是我找不到任何关于如何使用它的文档。
有没有人能够在Xcode11beta3中成功地使用UIAction?
发布于 2019-07-04 00:14:54
我不明白您从哪里获得options参数。它在我的机器上使用Xcode 11 beta 3编译和运行(没有崩溃):
let action = UIAction(__title: "Howdy", image: nil, identifier: nil) {
_ in
}发布于 2019-07-11 20:20:50
查看WWDC https://developer.apple.com/videos/play/wwdc2019/224/和goto time 44:46。
https://stackoverflow.com/questions/56874175
复制相似问题