views:

246

answers:

2

I have this subclass of UIScrollView:

@interface MyScrollView : UIScrollView <UIScrollViewDelegate>

And I have those delegate methods

- (void)scrollViewDidEndZooming:(UIScrollView *)aScrollView withView:(UIView *)view atScale(float)aScale{
    NSLog(@"zoomed");
}
- (UIView *)viewForZoomingInScrollView:(UIScrollView *)aScrollView{
    NSLog(@"willzoom");
}

When I zoom in MyScrollView viewForZoomingInScrollView is called but scrollViewDidEndZooming never gets called.

Any idea why??

A: 

Ok, completely revised answer based on your comment below. This may just be another typo, but your method signature is missing the final parameter.

Instead of:

- (void)scrollViewDidEndZooming:(UIScrollView *)aScrollView withView:(UIView *)view atScale{
    NSLog(@"zoomed");
}

You should have:

- (void)scrollViewDidEndZooming:(UIScrollView *)aScrollView withView:(UIView *)view atScale:(float)aScale{
    NSLog(@"zoomed");
}
Justin Gallagher
Jorge
My code is based on that one. For simplifying the question i changed the code inside the delegates for NSLog calls. The result is the same: viewForZoomingInScrollView is called but scrollViewDidEndZooming is not
Jorge
Damn.... you are right.Typo again :-( I have it just you said I should but it's still not getting called.
Jorge
A: 

I have the same problem, scrollViewDidEndZooming method is called in viewController of the scrollView although the viewController is NOT the delegate of scrollView! although the delegate is NULL! I can't understand it!

cescobaz