I'm not sure how it works: I was following this post:
I should know when Scroll Weascroll does when to do some custom things. I did the UIWebView subclasses what I did so far:
- (zero) scrollviewdcroll: (UISCrawview *) scrollview {[super scrollwidgetscroll: scrollview]; NSLog (@ "% s", __FUNCTION__); } This crashes on the [super scrollViewDidScroll: scrollView] method. When I remove that line, it works fine. I do not want to remove the implementation of this method of superclass. I just wanted to add it to some custom functionality (keep an app bar on top of the webpage as a Facebook app) Is there any reason that it is crashing? Thank you.
Do you really implement UIWebView representative method? Because it seems that this is probably not it. You should use the following when overriding optional representative methods like this: - (zero) scrollViewDidScroll: (UIScrollView *) scrollview {if ([UIWebView instancesRespondToSelector: _cmd]) {[Super ScrollViewDidScroll: scrollview]; } NSLog (@ "% s", __PRETTY_FUNCTION__); } Not only will this avoid super calling if Super Class actually does not apply to the method, but it will call your super if an OS update never starts responding to the Super Class The method will start due to the method.
Also keep in mind, you need to hardcode the superclass name (like UIWebView ). Either trying to use [self super class] or [super class] is going to give you the wrong result.
Comments
Post a Comment