我正在使用 GPUImage ( https://github.com/BradLarson/GPUImage ),并希望实现一个继承基类 GPUImageOutput 的类并实现 GPUImageInput 协议(protocol)。
得到错误: 具有 Objective-C 选择器“shouldIgnoreUpdatesToThisTarget”的方法“shouldIgnoreUpdatesToThisTarget()”与具有相同 Objective-C 选择器的父类(super class)“GPUImageOutput”中“shouldIgnoreUpdatesToThisTarget”的 getter 冲突
Swift 中有解决此问题的方法吗?
我唯一的解决方案是: 实现 Obj-C“虚拟基类”并在 Swift 中继承它们?!
最佳答案
尝试使用不同的 getter 从基类重新声明属性:
@property(readwrite, nonatomic, getter=superclass_shouldIgnoreUpdatesToThisTarget) BOOL shouldIgnoreUpdatesToThisTarget;
关于objective-c - 与父类(super class)属性名称和协议(protocol)方法名称冲突,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36628206/