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

sujithkrishnan

macrumors 6502
Original poster
May 9, 2008
265
0
Bangalore
Hi all.

In my iPhone app, i am having a class inheriting UIView, and i implemented

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event

I added some labels and imageview to that class and the method is getting fired wherever i touch in the view. I added a SrollView to that view and when i touch the scroll view and contents inside it, the method is not firing.
Moreover its a delegate method...

remember the scrollview is subview of main view, which is having the above delegate method implemented.....

Why so???

Is Scrollview is different from other views???

How to recognize a touch in scrollview or its content views???

I went thru a method

"- (BOOL)touchesShouldBegin:(NSSet *)touches withEvent:(UIEvent *)event inContentView:(UIView *)view; // default returns YES
"

for scrollview, but its a instance method, how to implement it to return true??

Or i want to add views inside scrollview instead of scrollview inside view

The main criteria is that i want to make a image in my view zoomable.

Thanks...
 
W

wuf810

Guest
Did you manage to get this working? I too cannot get

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event

to work. Anyone any idea how to implement this?

Thanks, M.

Hi all.

In my iPhone app, i am having a class inheriting UIView, and i implemented

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event

I added some labels and imageview to that class and the method is getting fired wherever i touch in the view. I added a SrollView to that view and when i touch the scroll view and contents inside it, the method is not firing.
Moreover its a delegate method...

remember the scrollview is subview of main view, which is having the above delegate method implemented.....

Why so???

Is Scrollview is different from other views???

How to recognize a touch in scrollview or its content views???

I went thru a method

"- (BOOL)touchesShouldBegin:(NSSet *)touches withEvent:(UIEvent *)event inContentView:(UIView *)view; // default returns YES
"

for scrollview, but its a instance method, how to implement it to return true??

Or i want to add views inside scrollview instead of scrollview inside view

The main criteria is that i want to make a image in my view zoomable.

Thanks...
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.