1

How to populate view in Xamarin 中,我能够使用一堆字符串设置表格视图,但是如何访问用户选择的字符串值?我知道在上一个问题中,我必须重写一些方法来填充表格视图。我必须这样做才能访问字符串值吗?如果是这样,我需要覆盖哪种方法?

4

1 回答 1

1

解决了我的问题。花了一些时间来弄清楚,但需要做的是:

1. Go to the .xib file in Xcode.
2. Double or triple click the inner cell to get the cell isolated.
3. Connect that cell to the controller file or the .h file in Xcode. 
4. Save. 

1. Then go to Xamarin.
2  Use use the table view object, which in my case is `tableview`
3. Set the object's `Cell` property to the the `NSTextFieldCell` object. `tableview.Cell = yourNSTextfieldObject`
4. To get the string value: `tableview.Cell.StringValue`
于 2013-08-18T21:44:11.553 回答