I was wondering if synthesize has some sort of support for dot syntax. My goal here is just to learn more about it – I realize I can achieve the goal by defining the getter myself. I have been looking for info on this topic without much success so far.
Example of what I want to do:
@synthesize name = self.someObject.name;
Which, as a getter, would be something along the lines of:
-(NSString*)name
{
return self.someObject.name;
}
No, you can’t do this. The value after the
=in@synthesizemust reference an ivar of the current class. You’re free to implement the above getter as you’ve noted, but@synthesizewon’t do it.