I am migrating my own objective-C application to the Monotouch solution.
I have a table view in my storyboard with some static table cells.
Using the following objective-C code a retrieved selection from a table
- (void) tableView:(UITableView *) aTableView didSelectRowAtIndexPath:(NSIndexPath *) indexPath { // remove the row highlight [aTableView deselectRowAtIndexPath:indexPath animated:YES]; switch(indexPath.row) { case 0: [self callWebsite]; break; case 1: [self sendEmail]; break; case 2: [self makePhoneCall]; break; } return; }
Now I want to do the same in MonoTouch, but I canβt find out how all the examples that I find on the network use DataSource and UITableViewDelegate.
But when using this approach, my "static" cells are deleted, replaced.
This is what I'm trying
public partial class ContactViewController : UITableViewController { public ContactViewController (IntPtr handle) : base (handle) { this.TableView.Delegate = new CustomTableViewDelegate(); } } public class CustomTableViewDelegate : UITableViewDelegate { public override void RowSelected (UITableView tableView, NSIndexPath indexPath) {
Anyone suggest?
source share