0
가속도계에서 이미지보기를 이동하는 뷰 컨트롤러를로드하려고합니다. 제목의 오류가 표시되고보기로드시 앱이 다운됩니다."countByEnumeratingWithState : objects : count :"오류
- (void)collsionWithWalls {
CGRect frame = self.Mover.frame;
frame.origin.x = self.currentPoint.x;
frame.origin.y = self.currentPoint.y;
for (UIView *image in self.wall) {
if (CGRectIntersectsRect(frame, image.frame)) {
// Compute collision angle
CGPoint MoverCenter = CGPointMake(frame.origin.x + (frame.size.width/2),
frame.origin.y + (frame.size.height/2));
CGPoint imageCenter = CGPointMake(image.frame.origin.x + (image.frame.size.width/2),
image.frame.origin.y + (image.frame.size.height/2));
CGFloat angleX = MoverCenter.x - imageCenter.x;
CGFloat angleY = MoverCenter.y - imageCenter.y;
if (abs(angleX) > abs(angleY)) {
_currentPoint.x = self.previousPoint.x;
self.MoverXVelocity = -(self.MoverXVelocity/2.0);
} else {
_currentPoint.y = self.previousPoint.y;
self.MoverYVelocity = -(self.MoverYVelocity/2.0);
}
}
}
}
오류는 줄에 보여줍니다 (self.wall에있는 UIView * 이미지) {에 대한
도와주세요!
전체 오류 메시지를 표시하십시오. 그리고'self.wall'의 데이터 타입은 무엇입니까? – rmaddy
벽은 발동기가 튀어 나오게하는 이미지입니다. 오류가 표시됩니다 : 컬렉션 표현 형식 'UIImageView *' 'countByEnumeratingWithState : objects : count :' – Yugaman
에 응답하지 않을 수도 있습니다. 아마도 당신은'for (UIImage * image in self.wall.animationImages)'를 원할 것입니다. – rmaddy