How to handle Objective-C protocols that contain properties?

The protocol is just telling everyone that knows about your class through the protocol, that the property anObject will be there. Protocols are not real, they have no variables or methods themselves – they only describe a specific set of attributes that is true about your class so that objects holding references to them can use them in specific ways.

That means in your class that conforms to your protocol, you have to do everything to make sure anObject works.

@property and @synthesize are at heart two mechanisms that generate code for you. @property is just saying there will be a getter (and/or setter) method for that property name. These days @property alone is enough to also have methods and a storage variable created for you by the system (you used to have to add @sythesize). But you have to have something to access and store the variable.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)