BollywooD
Dec 20, 2008, 01:20 AM
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:
- (void)move {
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1.0];
imageView1.center = Center1;
imageView2.center = Center2;
imageView3.center = Center3;
[UIView commitAnimations];
}
ive tried using:
if (imageView1.center == Center2) {
imageView1.center = Center1;
imageView2.center = Center3;
imageView3.center = Center2
}
else if (imageView1.center = Center3) {
imageView1.center = Center1
imageView2.center = Center2;
imageView3.center = Center3;
}
but i get the error
"error: invalid operands to binary =="
its probably really simple, but im stumped.
can any one help.
thanks in advance
Here is my code i am trying to implement it into:
- (void)move {
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1.0];
imageView1.center = Center1;
imageView2.center = Center2;
imageView3.center = Center3;
[UIView commitAnimations];
}
ive tried using:
if (imageView1.center == Center2) {
imageView1.center = Center1;
imageView2.center = Center3;
imageView3.center = Center2
}
else if (imageView1.center = Center3) {
imageView1.center = Center1
imageView2.center = Center2;
imageView3.center = Center3;
}
but i get the error
"error: invalid operands to binary =="
its probably really simple, but im stumped.
can any one help.
thanks in advance
