What is @property, @synthesize, @implementation, @interface in iphone programming?

I am new to iPhone programming and want to know:

What is @property, @synthesize, @implementation, @interface in iPhone programming?

+4
source share
2 answers

@property generates prototypes for the getter and setter methods. Usually you place it in the @interface block, which itself is in the .h file. In the @interface block, you declare methods and attributes of objects.

@synthesize generates getter and setter methods. Usually you place it in the @implementation block, which itself is in the .m file. The @implementation block is where you write the code for the methods of the object.

+13
source

@property is a C object directive that allows us to generate accessors.here we can specify the name and type of property

The @synthesize directive automatically creates setters and getters for us

• interface: the class interface is usually stored in the .h file and defines instance variables and public methods.

• implementation: the implementation of the class in the .m file and usually contains the actual method code

+2
source

Source: https://habr.com/ru/post/1335657/


All Articles