There is quite a bit of variety in declaring instance variables in ObjC (an annoying amount of variety). What you are looking at is something fairly recent.
Let’s say you declared an instance variable in some SourceObj.h
"@property (nonatomic, weak) RSSChannel *parentParserDelegate;"
Case 1: you do NOT have an associated “@synthesize parentParserDelegate;” in SourceObj.m
then your use of this instance variable will be:
ObjC will automatically do the synthesize for you, but !!! it’s making the instance variable start with an “_”, which apparently is the new trendy thing to do. Also, it’s all over the apple sample code so it might be an uphill battle to fight this.
Case2: you add “@synthesize parentParserDelegate;” in SourceObj.m
then this works:
Oddly, the getter and setter are the same either way, whether you @synthesize or not.
getter will be:
id obj = [self parentParserDelegate];
setter will be:
So, at this point in ObjC, it looks like @synthesize only determines what style of instance variable (with “_” or not) you want.
I could be really wrong about this so “do you own due diligence”, and please correct me if I’m spreading misinformation. It looks like a fairly recent change in Xcode/ObjC, some time after Xcode 4.3?. (I’m using Xcode 4.6.2).
Personally, I dislike my instance variables starting with “_”, it just doesn’t look nice and Xcode highlights instance variables differently anyway so, where is the need for this coming from?