听起来很蠢但是......
我是一个使用公共方法的快速课程
class PlayerVC: UIViewController {
func retrievePixelBufferToDraw(strongSelf: PlayerVC) -> CVPixelBuffer? {
...
return pixelBuffer
}
}
我试图从Objective-C课程中调用它(免责声明我是Objective-C的初学者,我可以在线找到答案..),如:
PlayerVC* VC = self.playerController;
CVPixelBufferRef pixelBuffer = [VC retrievePixelBufferToDraw:VC];
但语法不正确。 (No visible @interface for 'PlayerVC' declares the selector 'retrievePixelBufferToDraw:'
)我尝试了各种包围,冒号,变量等名称
答案 0 :(得分:2)
出于某种原因,答案是:
PlayerVC* VC = self.playerController;
CVPixelBufferRef pixelBuffer = [VC retrievePixelBufferToDrawWithStrongSelf:VC];
不知道retrievePixelBufferToDrawWithStrongSelf
来自哪里,可能来自Swift和Objective C之间的自动桥接。这听起来很糟糕。反正..!