scrollView.bounces works properly on iOS 5 but when executed on iOS 4, sigabrt error is shown. How to set it working for both os? Thank you
- (void)viewDidLoad
{
[super viewDidLoad];
[spinner startAnimating];
[self.webView1 setDelegate:self];
self.webView1.scrollView.bounces = NO;
self.webViewB.scrollView.bounces = NO;
[self loadIt];
}
Your problem is not the setting the
bouncesproperty of thescrollViewbut rather trying to access thescrollViewproperty of thewebView1andwebViewBobjects. Before iOS 5.0 this property was not public so you cannot access it like that.You would have to go trough all the suviews of the
webView1andwebViewBand find the one that’s aUIScrollViewand than set it’sbouncingproperty. You can do that like this:Let me know if that works for you.