部分代码
/*eventreporterViewController.m*/
/*eventreporterViewController.m*/
-(void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{
[self.nextResponder manageTouches:touches];
}-(void) touchesENDed:(NSSet *)touches withEvent:(UIEvent *)event{
[self.nextResponder manageTouches:touches];
}-(void) touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event{
[self.nextResponder manageTouches:touches];
}-(void) manageTouches:(NSSet *)touches{
for(UITouch *touch in touches){
if(touch.phase == UITouchPhaseBegan){
CGPoint touchPos = [touch locationInView:self.view];
startField.center = touchPos;
startField.text = [NSString stringWithFormat:@"Begin: %3.0f,%3.0f",touchPos.x,touchPos.y];
}
else if (touch.phase == UITouchPhaseMoved){
bottonLabel.text = @"Touch is Moving~";
}
else if (touch.phase == UITouchPhaseEnded){
if(touch.tapCount > 1){
bottonLabel.text = [NSString stringWithFormat:@"Taps: %2i",touch.tapCount];
}
else {
bottonLabel.text = [NSString string];
}
CGPoint touchPos = [touch locationInView:self.view];
endField.center = touchPos;
endField.text = [NSString stringWithFormat:@"End:%3.0f,%3.0f",touchPos.x,touchPos.y];
}
}
}有几个警告这是链接
/*eventreporterViewController.m*/
/*eventreporterViewController.m*/
-(void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{
[self.nextResponder manageTouches:touches];
}-(void) touchesENDed:(NSSet *)touches withEvent:(UIEvent *)event{
[self.nextResponder manageTouches:touches];
}-(void) touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event{
[self.nextResponder manageTouches:touches];
}-(void) manageTouches:(NSSet *)touches{
for(UITouch *touch in touches){
if(touch.phase == UITouchPhaseBegan){
CGPoint touchPos = [touch locationInView:self.view];
startField.center = touchPos;
startField.text = [NSString stringWithFormat:@"Begin: %3.0f,%3.0f",touchPos.x,touchPos.y];
}
else if (touch.phase == UITouchPhaseMoved){
bottonLabel.text = @"Touch is Moving~";
}
else if (touch.phase == UITouchPhaseEnded){
if(touch.tapCount > 1){
bottonLabel.text = [NSString stringWithFormat:@"Taps: %2i",touch.tapCount];
}
else {
bottonLabel.text = [NSString string];
}
CGPoint touchPos = [touch locationInView:self.view];
endField.center = touchPos;
endField.text = [NSString stringWithFormat:@"End:%3.0f,%3.0f",touchPos.x,touchPos.y];
}
}
}有几个警告这是链接
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货