views:

50

answers:

0

Hi All,

I would like to ask, is it correct to recreate content view in scrollViewDidEndZooming method? Is there any potential problems with this? I use the following code:

- (void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(UIView *)view atScale:(float)scale {
   [self.contentView removeFromSuperview];

   self.contentView = [[ContentView alloc] init ...];
   ...

   [scrollView addSubview:self.contentView];
}

and with the simulator everything works correctly, but when I run this example on device sometimes when I zoom with pinch gesture I have a scale value set to 1.0 that is very strange because actually it should be set to zoom scale that differ from 1.0. Also, could somebody advice should I add self.contentView = nil after removeFromSubview call?

NOTE: I use SDK 3.1.2

Thank you in advance