Before ios5 I was able to access a UIWebView's UIScrollView delegate like this:
for (id subview in webView1.subviews){
if ([[subview class] isSubclassOfClass: [UIScrollView class]]) {
UIScrollView * s = (UIScrollView*)subview;
OldDelegate = s.delegate;//OldDelegate is type id
s.delegate = self;
}
}
Now, I know that's not the right way to do it, but at the time (as far as I understood) it was the only way to do it. iOS 5 has changed that, so I am trying to do it the iOS 5 way:
UIScrollView * s = webView.scrollView;
Olddelegate = s.delegate;
s.delegate = self;
But either way I try to do it, the value of my OldDelegate object is 0x0. It is really important that I retain this delegate value, but try as I might, I'm just getting 0x0.
Any ideas?
I'm not using ARC...