gpt4 book ai didi

ios - 找不到合适的方法来覆盖 RowsInSection xamarin

转载 作者:可可西里 更新时间:2023-11-01 06:20:40 25 4
gpt4 key购买 nike

   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)' is marked as an override but no suitable method found to override (CS0115)

您好,我正在尝试使用 xamarin monotouch 制作一个 helloworld 应用程序,但我遇到了这个错误。有人可以帮我解决这个问题吗?

谢谢

最佳答案

我猜您使用的是统一 API。

在这种情况下使用这个(nint 而不是 int):

public override nint RowSelected(UITableView tableView, nint section)

关于ios - 找不到合适的方法来覆盖 RowsInSection xamarin,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27274134/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com