I have a MonoTouch iPhone app which has a UITableViewController as it’s main view controller.
I am trying to detect when the tableview is being scrolled with the code:
this.TableView.Scrolled += TableViewScrolled;
where TableViewScrolled(object sender, EventArgs e) { } is my method being called.
But it fails to call the TableViewScrolled() for some reason.
Does anyone have any experience with this?
@Krumelur’s comment on the previous answer makes a very good point and IMO should have been an answer (not a comment).
The point is that if your set a
Delegate(orWeakDelegate) to yourUITableViewthen it’s events won’t work anymore.Why ? because to implement those events MonoTouch creates it’s own internal delegate type for
UIScrollView(the parent ofUITableView) where it overrides the methods (of the delegate) and expose them as, more natural (in .NET), events inside the type.This effectively means that you cannot mix those
UITableViewevents with your own delegateUITableViewDelegatetype (since the later will override the former).