There is no suitable method to override RowsInSection xamarin

   class CallHistoryDataSource : UITableViewSource
    {
        CallHistoryController controller;

        public CallHistoryDataSource (CallHistoryController controller)
        {
            this.controller = controller;
        }

        public override int RowSelected(UITableView tableView, int section)
        {
            return controller.PhoneNumbers.Count;
        }
        //
        // Returns a table cell for the row indicated by row property of the NSIndexPath
        // This method is called multiple times to populate each row of the table.
        // The method automatically uses cells that have scrolled off the screen or creates new ones as necessary.
        //
        public override UITableViewCell GetCell (UITableView tableView, NSIndexPath indexPath)
        {
            var cell = tableView.DequeueReusableCell (CallHistoryController.callHistoryCellId);

            int row = indexPath.Row;
            cell.TextLabel.Text = controller.PhoneNumbers [row];
            return cell;
        }
    }

      

`Helloworld_iOS.CallHistoryController.CallHistoryDataSource.RowSelected (UIKit.UITableView, int) 'marked as override, but no matching method found to override (CS0115)

Hi I am trying to make a helloworld app using xamarin monotouch and I am accepting this error. Can anyone help me?

thank

+3


source to share


1 answer


I am assuming you are using the unified API.

In this case, use this ( nint

instead of int

):



public override nint RowSelected(UITableView tableView, nint section)

      

+11


source







All Articles