I'm just starting iOS development with Xamarin and it seems to hit the road block. I am trying to create a custom table cell to display some data. Therefore, taking tips from various online sources (for example, here ), I created a .xib file, deleted the view that Xamarin automatically created, and replaced a UITableViewCell . I added a few shortcuts to my cell, I registered my cell with RegisterNibForCellReuse and set up my class, which inherits from UITableViewSource , to return my custom cell when needed. So far so good.
The problem starts when I take any controls in my user cell and try to create an output. In Xcode, create a power outlet and everything will be fine. Back in Xamarin, I see that it automatically creates a property for it.
[Register ("MyCustomCell")] partial class MyCustomCell { [Outlet] MonoTouch.UIKit.UILabel MyLabel { get; set; } void ReleaseDesignerOutlets () { if (MyLabel != null) { MyLabel.Dispose (); MyLabel = null; } } }
But when I try to run the code, I get a runtime error saying This class in not key value coding-compliant for key the key MyOutlet
Any idea what could happen? Xamarin docs suggest a possible reason here , but I'm not sure if this is relevant. I donโt see anything like it in any of the Xamarin designer files, and everything is fine with them. I tried to replace the property definition above with one that uses the Connect attribute instead of Outlet and uses GetNativeField and SetNativeField , but I see the same result.
source share