Question

Im not too used to cocoa yet, so please bear with me

I am writing a game for mac in Objective-C on cocoa, and I have one problem:

I have two NSImageViews, and i need to set it up so that if I move one, the other one follows it ON THE Y AXIS ONLY. How do I find out the coordinates of the first image so that i can apply the x value to the second one?

Any help is greatly appreciated

Was it helpful?

Solution

I'm not sure if this works with NSImageView, but it works with UIImageView.

yourImage.frame.origin.x;

I hope that helps

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top