你好,我正在尝试将移动点存储在NSMutableArray
中,所以我尝试了以下方法:
-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
UITouch *move = [[event allTouches] anyObject];
CGPoint MovePoint = [move locationInView:self.view];
if (MovePointsArray==NULL) {
MovePointsArray=[[NSMutableArray alloc]init];
}
[MovePointsArray arrayWithObjects:[NSValue valueWithCGPoint:MovePoint]];
}
但是这种方式不起作用,我应该如何将这些点存储在
NSMutableArray
中?