I am trying to create a set of if statements, depending on the initial position of 3 objects, will decide which position they all move to. (does that make sense?)
Here is my code i am trying to implement it into:
I am trying to create a set of if statements, depending on the initial position of 3 objects, will decide which position they all move to. (does that make sense?)
Here is my code i am trying to implement it into:
but i get the error
"error: invalid operands to binary =="
its probably really simple, but im stumped.
can any one help.
thanks in advance
Let's play spot the coding errors game:
1) missing ; after imageView3.center = Center2
2) missing ; after imageView1.center = Center1
3) you are assigning a value with (imageView1.center = Center3), if you want to see if they are equal you need ==
1) missing ; after imageView3.center = Center2
2) missing ; after imageView1.center = Center1
3) you are assigning a value with (imageView1.center = Center3), if you want to see if they are equal you need ==
Anyone else?
whoops....
the coding was correct in my app, i just copied it into the forum with errors.
I worked it out anyhow, I needed to compare the two values like this:
if (CGRectContainsPoint([imageView1 frame], Center2)) {