self.myString = @"test"; exactly equivalent to writing [self setMyString:@"test"]; . Both of them call the method.
You could write this method yourself. It might look something like this:
- (void)setMyString:(NSString*)newString { _myString = newString; }
Since you used @synthesize , you do not need to actually write this method, you can just let the compiler write it for you.
So, looking at this method, it looks like it is calling the same thing as just assigning a value to an instance variable, right? Well, it's not that simple.
First, you can write your own setter method. If you do this, your method will be called, and it will be able to do all kinds of additional things, as well as set a variable. In this case, using self.myString = will call your method, but _myString = will not be executed, and therefore various functions will be used.
Secondly, if you ever use Key Value Observing, the compiler does some very smart tricks. Behind the scenes, he subclasses your class and redefines your setter method (regardless of whether it was written by you or you generated by the synthesis) to make calls to willChangeValueForKey: that are needed to verify the key value to work. You do not need to know how this works (although it is quite interesting if you want to read reading in a dream!), But you need to know that if you want Key Value Observing to work automatically, you need to use setter methods.
Third, calling the setter method, even if you rely on synthesis for writing, gives you flexibility in the future. You might want to do something extra when the value is changed, and the moment you find that you want to do this, you can manually write the setter method - if you used to always use self.myString = , then you won you need to change the rest of the code to start calling a new method!
Fourth, the same applies to subclasses. If someone else had to subclass your code, if you use setters, then they can override them to configure functionality.
Each time you directly access an instance variable, you obviously do not provide the ability to add additional functions at this point. Since you or someone else wants to use this functionality in the future, he pays for the use of installers all the time, if there is no good reason not to do so.