这里没有很多细节在你的问题和评论...
如果override
的RowSelected
方法,那么你很可能从UITableViewSource
权继承了新的类型?如果是这样,那么你应该让它的构造函数保留对UITableViewController
的引用,并在稍后使用此引用来呼叫PresentModalViewController
。
E.g.
public class MyTableViewSource : UITableViewSource {
UITableViewController ctrl;
public MyTableViewSource (UITableViewController c)
{
ctrl = c;
}
public override void RowSelected (UITableView tableView, NSIndexPath indexPath)
{
tableView.DeselectRow (indexPath, true);
var home = new UIViewController ("YouNibName", null); // default bundle
ctrl.PresentModalViewController (home, true);
}
}
注:我以前UIViewController
但你很可能已经为你的NIB定义的类型。
为什么在地球上你用什么看起来像普通的C方法?在UITableViewController中使用objective-c方法。 –
他的帖子被标记为MonoTouch - 这是C#,而不是Obj-C – Jason
对不起,我不知道你可以编程为iPhone而不使用Obj-C –