I am new to iPhone/Objective-C programming. I have a UIImageView *myImage whose x,y,width,height are set using CGRect with values (20,20,100,100) or whatever;
Q1) When I do the following why can't i fetch the origin values into CGPoint.
CGPoint myPoint = myImage.frame.origin;
NSLog(@"X:%f Y:%f",mypoint.x, mypoint.y) // Prints X: 0.0 and Y: 0.0 instead of X:20.0 and Y: 20.o
NSLog(@"X:%f Y:%f",myImage.frame.origin.x, myImage.frame.origin.x) // Prints X: 20.0 and Y: 20.0
The above NSLog statements do not print the expected values for myPoint but prints the right values for myImage.frame.origin. Why?
Q2) Also why can't I set @property to CGPoint ?