Im trying to figure out a way to move a UILabel to different pre determined points on the screen at random (that is, to choose from a list of pre determined points randomly and move there).
My initial thoughts is to write a method that will choose randomly from an array but would I need two seperate arrays for the x and the Y? Any suggestions or a point in the right direction would be greatly appreciated.
You could adapt the code from this question (getting a random object from an array)
Random Text Sent to UILabel
You could store the CGPoint in an NSValue, and then in the array (as you can’t put a CGPoint directly in an NSArray as it’s not an object) Eg:
(The example code just above stores just 2 points, you can have as many as you like, and the first value is if the CGPoint already exists/created dynamically and the second value is if you want to make the point on the spot)
Bringing the code across from the question I linked to, and adapted it to your question: