When Property Declaration is Inevitable - Objective C 2.0

While working on a maintenance project, I am struggling with a lot of dirty code. In the current assignment, I found that the previous developer defined a property (and synthesizes) for each iVar and IBOutlet of this class.

According to my understanding, I was used to correctly declare only the variable that I intended to use outside of this class. And most of the time I do not need to declare a property (and synthesize, of course) for any of the IBOutlet.

Can I have any answer or document "When to declare a property and synthesis is necessary (or important)"?

EDIT:

After reading the message that Dr. Kameleon pointed out, the following question comes to my mind: what loopholes can be present in the code if I declare each iVar as a property and synthesize them? Can I go this way?
+3
source share
2 answers

, , - . , , . IBOutlet frazmabob, . , , , . , - /, .

, , OO, , . , , , . - .

+1

, ivar. -

ivar -

  • ivar .

-

  • KVO.
  • , Accessors.

- http://cocoawithlove.com/2010/03/dynamic-ivars-solving-fragile-base.html

-, , ivars.

+1

All Articles