I've been playing with iOS for several months, always use @synthesize to "make setter and getter" of @property. But in some tutorials, I often see @synthesize param = _param, I don't quite get its meaning.
For example: in .h file
@property (nonatomic, retain) NSString *param1;
@property (nonatomic, retain) NSString *param2;
in .m file
@synthesize param1; //this is what I like to do
@synthesize param2 = _param2; // this is what 'experienced' programmer does
From my habit, I can use self.param1, or just param1 to get this instance, is there any difference by the way?
From others, they seem like to use _param2 instead of other approach. I know it has something to do with getter/setter, but I still not quite clear.
Could someone explain their difference and pros/cons?
Thanks a lot.