I have an Objective-C method which uses some x and y values from an image: image.center.x and image.center.y. I want to store them away every time this method is called, so I was hoping to use an array.
How can this be done? I suspect using an NSMutableArray?
I would recommend storing the points in an NSArray, wrapped using NSValue:
This assumes that
image.centeris a CGPoint struct (if not, you can make one usingCGPointMake()).To extract the CGPoint, simply use