0
當我使用[觸摸previousLocationInView]的參數時,Xcode已經警告「不兼容的指針類型發送...」不兼容的指針類型發送「PTTouchScene *爲鍵入「的UIView *」
爲什麼?
這裏是我的代碼:
- (void)touchMoved:(UITouch *)touch withEvent:(UIEvent *)event {
[super touchMoved:touch withEvent:event]; CGPoint touchLocation = [touch locationInNode:self]; CGPoint preTouchLocation = [touch previousLocationInView:self];// --> Incompatible pointer types sending PTTouchScene * to parameter of type UIView *
}
對不起,我不明白你的答案 –
你傳遞了錯誤的對象' previousLocationInView:'。嘗試傳遞'self.view',而不是'self'。 – sartak
沒有。 self = CCScene –