我想为 UIScrollViewDelegate
使用多播委托(delegate)技术.我的总体想法与此类似:
https://github.com/tkach/MulticastDelegate/blob/master/MulticastDelegate/MulticastDelegate.m
但我无法转发 scrollViewDidScroll
消息,我发现我从来没有收到过这条消息。
那么有没有人遇到或者知道这是什么原因呢?
谢谢...
最佳答案
我认为 UIScroll
出于某种性能原因,将缓存其委托(delegate)。您必须 首先准备您的多播委托(delegate) .然后将原始委托(delegate)设置为 UIScroll
.最后 UIScroll
会知道你已经实现了 scrollViewDidScroll
方法。
当您想更改您的多播委托(delegate)时,请记住重置 UIScroll
的原始委托(delegate)像这样:
self.scrollView.delegate = nil;
self.scrollView.delegate = yourMulticastDelegate;
关于ios - ObjC 未正确转发 scrollViewDidScroll 消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34205570/