What is the difference between IBOutlet as a property or as a variable?

前端 未结 2 1789
北恋
北恋 2020-12-21 08:20

There are two different methods to declare IBOutlet.

  1. In @interface section as variable:

    IBOutlet UIButton *exampleButton;
    
2条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-21 09:12

    The @property combined with @synthesize setup the getter and setter methods for your objects. You should define it at least in the interface, and if you decide to create a property from it then you must also synthesize it the .m file.

提交回复
热议问题