iPhone/Objective-C プログラミングは初めてです。UIImageView *myImage があり、その x、y、幅、高さは CGRect を使用して値 (20,20,100,100) などで設定されています。
Q1) 以下を実行すると、元の値を 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
上記の NSLog ステートメントは、myPoint の期待値を出力しませんが、myImage.frame.origin の正しい値を出力します。なんで?
Q2) @property を CGPoint に設定できないのはなぜですか?