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)」被標記爲超馳,但發現重寫(CS0115)沒有合適的方法發現重寫RowsInSection xamarin
您好我正在嘗試使用xamarin monotouch創建一個helloworld應用程序,並且我正在接受這個錯誤。有人能幫我解決這個問題嗎?
謝謝
是你的類從UITableViewSource繼承? – Jason 2014-12-03 14:33:57
是它繼承自UITableView – mkayaa93 2014-12-03 14:36:35
不,我問是否繼承自UITableViewSource **。這是RowSelected方法的基類。 – Jason 2014-12-03 14:38:13