They're doing whatever you told them to do in the property statement or your own implementation, if you chose to write one. Most often, the reason for using the accessors rather than directly modifying instance variables is to avoid memory leaks. Imagine an NSString instance variable declared with.
They're doing whatever you told them to do in the @property statement or your own implementation, if you chose to write one. Most often, the reason for using the accessors rather than directly modifying instance variables is to avoid memory leaks. Imagine an NSString instance variable declared with @property (nonatomic, retain) NSString *myString; @synthesize myString; These lines generate an accessor that correctly calls release and retain when you want to change the myString property of an object.
If you didn't call the accessor, you could potentially leak the old value, unless you were careful to do the memory management yourself.
Your base precept: There are certain places where you have to use self. Property instead of just property in order to make use of the setter and getter methods, such as in dealloc and initWithCoder. This tells me that these setter and getter methods are doing something else that's important... isn't quite correct.
The difference here is that using self. Propertyname specifically invokes the getter/setter when used within that class, where directly using propertyname doesn't - it accesses the instance variables directly. Per @Carl Good practice is that you use the getter/setter sequence everywhere you absolutely can, as that keeps you pretty safe from missing a corner case of memory management.
I second what @heckj and @Carl said, but must add one more point. In general it is not safe to use accessors in either init or dealloc. The problem is that you class might be subclassed, the accessors might be overridden.
Then these accessors might access other properties of your class or a subclass. This might lead to crashes: In the case of init these haven't been initialized yet (because in init the first call you do is super init). In the case of dealloc these have already been freed (because in dealloc the last call you do is super dealloc).
In practice you may use accessors in init and dealloc. Under two premisses: You know what you're doing. (see above) You control all maybe inheriting code.(does not apply for frameworks, etc.).
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.