Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Danneman101

macrumors 6502
Original poster
Aug 14, 2008
361
1
Im trying to implement a popupview that targets a button inside a webview.

For that purpose I need to get the CGRect of the that button, which I figure is best done by getting the position of the last touch using the UIResponder > touchesEnded method.

Problem is, I dont have a clue where to put the code. I tried all my projects files (which is an iPad split-view app, containing two viewcontrollers and a appdelegate), but none of them trigger the method.

Code:
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
	UITouch *touch = [touches anyObject];
	CGPoint touchPosition = [touch locationInView:self.view];
// DEBUG:
	NSLog(@"--== touchPosition = %@", NSStringFromCGPoint(touchPosition));	
// TODO: Construct CGRect somehow using the CGPoint
}
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.