views:

27

answers:

1

I am trying to create a small augmented reality application where I move an image on top of the camera capture. So the only thing I change is the center of the UIImageview:

[imageView1 setCenter:CGPointMake(x-16, 240)];  

and the center gets updated but the position of the image on the screen stays the same.

after the center update, this gets called:

[self.imageView1 performSelectorOnMainThread:@selector(setImage:) withObject:testImage waitUntilDone:YES];

The funny thing is that in the first iteration it actually updates the position. But only the first time. Any ideas?

A: 

Try:

imageView1.center = CGPointMake(imageView1.center.x-16, 240);
ohho
x is not a coordinate, it's a double value calculated in every iteration. I should've written that in the original post. But anyway, when I write the center coordinates in the console everything is OK. So I am guessing it's a display problem of some sort.
is there a way to refresh an imageview? I tried with [imageView1 setNeedsDisplay]; but this doesn't seem to work....