I made one iPhone app in Objective-C. When I want to associate a shortcut with some data, I would declare it as follows:
@interface CityDetailViewController : UIViewController { UILabel *cityName; } @property(nonatomic, retain) IBOutlet UILabel *cityName;
And then, when the CityDetailViewController object is created in the code, I would set the city name as [self.cityView.cityName setText:city.name];
I cannot, in life, figure out how to do this in MonoTouch. I tried to manually create Outlets via Interface Builder, and I tried to add this code, which I found in the .designer.cs file from another project:
[MonoTouch.Foundation.Connect("headlineLabel")] private MonoTouch.UIKit.UILabel headlineLabel { get { return ((MonoTouch.UIKit.UILabel)(this.GetNativeField("headlineLabel"))); } set { this.SetNativeField("headlineLabel", value); } }
And I tried a combination of both of these things. They do not work. The closest I can get is actually apply the Outlet with Interface Builder, but when my view is announced, I get this error:
this class is not suitable for encoding keywords for the Label keyword header.
So, I am completely at a loss. Can someone please explain this to me?
source share