ios - Changing the objects position -


let's have single-view project , there have square uilabel. crate simple timer time interval of 0.05 seconds.

it launches void method has following code:

obj.center = cgpointmake(150+(80*cos(0.25*t)), 150+(80*sin(0.25*t))); obj.text=[nsstring stringwithformat:@"%i", t];  uiimageview *dot =[[uiimageview alloc] initwithframe:cgrectmake(150+(80*cos(0.25*t)),150+(80*sin(0.25*t)),20,20)]; dot.image=[uiimage imagenamed:@"circle.png"]; [self.view addsubview:dot];  t++; 

(where (150;150) center of circle path, 80 radius of , (0.25*t) used change angle time goes on)

as can see, changes label's position, moves along circular path. , wanted create uiimage right @ uilabel position, mark trajectory.

the problem label going round or uiimage created, forming circle if used separately. if use both lines of code uilabel , uiimage - label remains @ center of circle path, while images created around it.

i tried using label's x/y coordinates create images, , tried create detached method drawcircle. result still same.

if label told go round - so, else stays in center.


Comments