Help in "Programming in Objective-C" by Stephen Kochan
Hi, I've reached pg 169 of "Programming in Objective-C" and I have a question.
In that example,
.XYPoint class holds x and y points like in Cartesian System.
.Rectangle class has an instance variable XYPoint *origin.
.In the main routine,
myrect is Rectangle's object.
In book in NSLog statement,
myrect.origin.x has been used to get the origin's x value.
My question is:
"
1.How can we access 'origin' using dot operator when we haven't synthesized it?
2.Although Rectangle class has method named origin which returns 'origin',
we can't use dot operator to access a method. So how did it happen?
"
Thanks a lot. I'm a newbie so plz forgive me if i'm asking something stupid.
|