synthesizer - Objective-C synthesize property name overriding -


I am trying to understand the purpose of the synthesize directive with property name override. Say I have an interface defined by which to follow:

  @ interface dummy ... {UILabel * _dummyLabel; } @ Property (Maintaining, Non-Metric) UIL Babel * Dummy Label;  

And in the implementation file, I have:

synthesize dummyLabel = _dummyLabel;

Which I think, "Dummy label" is just the nickname of the frequency variable "_dummyLabel". Is there any difference between self._dummyLabel and self.dummyLabel?

Yes. self._dummyLabel is undefined, although _dummyLabel is not.

Dot syntax is spread out for simple method invocations, so it is not specific to the property if you have a method called - (id) someObject , for example < In the case of code> object.someObject , it will be as you wrote [object someObject]; .

  self.dummyLabel // works self._dummyLabel // does not work dummyLabel // works _dummyLabel // works [self dummyLabel]; // works [self _dummyLabel]; // does not work  

Comments