Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 03-11-2011, 09:10 AM   #30 (permalink)
cvcs1
Registered Member
 
Join Date: Oct 2010
Posts: 41
cvcs1 is on a distinguished road
Exclamation

Great Tutorial! Really helpful.

I have one question though, How do I check WHERE it is touched? I have this code in my "myImageView"

Code:
-(void) touchesBegan: (NSSet *) touches withEvent: (UIEvent *) event
{	
	UITouch *touch = [touches anyObject];
	CGPoint touchPoint = [touch locationInView:self];
	NSLog(@"Touch detected at: X = %d, Y = %d", touchPoint.x, touchPoint.y);
}
But that returns this in the log:

Code:
2011-03-11 07:05:56.969 Us![3428:207] Touch detected at: X = 0, Y = 1085492480
2011-03-11 07:05:57.322 Us![3428:207] Touch detected at: X = 0, Y = 1085492480
2011-03-11 07:05:57.529 Us![3428:207] Touch detected at: X = 0, Y = 1085492480
And that is DEFINITELY not where I touched it, and I moved quite a lot to try and get something else. Thanks!

EDIT: Nevermind... I was logging it incorrectly. :P

Last edited by cvcs1; 03-11-2011 at 09:26 AM. Reason: Stupidity
cvcs1 is offline   Reply With Quote
 

» Advertisements
» Online Users: 403
13 members and 390 guests
7twenty7, alexeir, DaveDee, eski, gogoman, Lily.P, lionelnlex, matador1978, Pudding, roof44, ryantcb, Sami Gh, Vijithasri06
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,595
Threads: 94,084
Posts: 402,780
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Vijithasri06
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 03:20 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.