Question

I am porting one of my iPhone apps to the mac, but I cant figure out how to move my NSImageViews around the screen, like i would do with CGpointMake. Also, how do you find the image.center.x in cocoa?

Any help would be great!

Was it helpful?

Solution

This sounds like you're searching for CoreAnimation.

CALayers are made for the things you want. You can specify their "anchorPoint" (their "center") free on them, so you can decide if their center should be in the upper-left corner, in the center or somewhere else. Also, they are made for animation and such stuff.

Porting from an UIView-Based application is very easy (I have done this myself). Views and Layers are very similar in many aspects.

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