Connect a UILabel in Interface Builder and XCode?

前端 未结 5 1260
梦如初夏
梦如初夏 2020-12-20 15:00

I am trying to do something as simple as add a Label to a View in XCode and IB and I can\'t figure out how to do it. All the samples I find online are for older versions of

5条回答
  •  执念已碎
    2020-12-20 15:44

    Make sure your property line looks like this:

    @property (nonatomic, retain) IBOutlet UILabel *label;
    

    Leave (or set) the type of the label as UILabel in Interface Builder. If that doesn't work, try File -> Reload All Class Files in Interface Builder. Your code looks good, but CardNameLabel should start with a lower-case 'c'.

提交回复
热议问题