im trying to implement some behaviors when a mapview element scrolls… by coding a delegate for the scrollview inside of a mapview.
so, right now, i got a pointer to the scroll view used by the map view in my code.
however, i wish to set the delegate of this scroll view inside the map view, but the issue is that the mapview already sets up a default delegate for this scroll view inside the map view.
can i make my delegate implement all of the messages of the protocol, explicitly sending them to the mapview’s default delegate while also implementing my own behaviors?
how else can i go about adding my own delegate behavior, to an already existing default delegate….?
thanks everyone,
michael
You could just get the existing delegate and save a reference for yourself:
And then set the object you want as the delegate:
Then when getting a delegate message, call the same method on
origDelegate, modify the response if you want to (or if necessary), and then return the modified response: