tags:

views:

161

answers:

0

HI

How to get the x& y value from the [B]touchesbegan[/B] to our method,i have made the sample like this to get the location of my TextField,and this location was taken in another method to calculate the location of the text and add text to the UIImage,im facing problem in this final stage to pass this parameter to the [B]CGContextShowTextAtPoint[/B], this is my code.

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
 UITouch *touch = [touches anyObject];
 NSUInteger tapCount = [touch tapCount];
 CGPoint location = [touch locationInView:touch.view];
 textBox.center = location; 
 NSLog(@"location-%f,%f", location.x,location.y);

}


- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
 NSLog(@"touches moved");
}
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
 NSLog(@"touches ended");
}

i need the value of the location.x,location.y,get passed to another method.so that i can fix the location of the text, can any one help me in this...

Thanks in advance