Some books explain that you should only use getter and setter to access your ivar, even if they are private. This is a little too psychotic for me.
Before clang, you need to create a category on the class and use a synthesizer to make ur ivar private. eg:
@interface AppDelegate () @property(nonatomic, assign)int aValue; @end
// + @implement AppDelegate // @synthetise aValue;
which can be annoying since someday you will need a simple ivar, without any getter / setter control. And add code that is not necessary.
Now with clang you can put ur ivar directly into the implementation file, similar to this in ur code:
@interface AppDelegate (){ int _aValue; } @end
And hide the private ivar from the header area. Please note: u cannot compile this with gcc.
source share