NSString *yValue;
yValue= [[NSString alloc] initWithFormat:@"%1.2f", imageView.center.y];
[label setText:yValue];
I am trying to display the y value of an imageview as it moves on the screen. When I use this code the label simply doesn’t appear. I’m not sure what im doing wrong any help is appreciated .Thanks!
You need to get the y value from the image’s frame and then convert that to a string and then set your label’s text.
Try:
** I haven’t tested this code but it should be close **