The main reason for not using access methods in intiailiser and dealloc methods is probably related to the development of Mac OS X and is probably not a problem for iOS. The development of the Mac OS X GUI includes a useful thing called βbindingsβ, which allows you to bind a control property to an object property, so when the user updates the control, the βbindingβ will automatically update the property, and if the program updates the property (via access methods), "binding" will automatically update the control.
A lot of required materials are carried out taking into account key values ββ(I think). Observation of key values ββis when an object observes changes in properties on other objects. Whenever you use the accessor method to change a property, any object that watches your object will be notified so that it can take action on the new property value. Using access methods can trigger any notification about monitoring key values ββif you do not want them to occur, for example, during initialization and release, since any observers of your object will only deal with a partially initialized or partially released instance, and not completely initialized instance.
There is another major problem that occurs when your object is a subclass. When you use access methods to set the properties of your object, you actually call the access methods of your subclass (if it implements various access methods). This is unlikely to be a problem because inheritance in Objective-C is rare compared to .NET.
dreamlax
source share