Objective C: “Property implementation must have its declaration in interface”

后端 未结 1 855
面向向阳花
面向向阳花 2021-01-11 19:09

I have the following code:

//RootViewController.h:

#import 

@interface RootViewController : UIViewController{
    IBOutlet UITe         


        
相关标签:
1条回答
  • 2021-01-11 19:17

    You need to declare the property with @property in your interface.

    @property( nonatomic, retain ) IBOutlet UITextField * login_uname;
    

    Here, non-atomic is used because it's an IBOutlet. Also note the property has the retain modifier, meaning you are responsible to release the object when you don't need it anymore.

    0 讨论(0)
提交回复
热议问题