title: Objective C-How to rotate an UIImageView over another UIImageView
body: <p>I am trying to create a Hygrometer. I have an image of Hygrometer and an image of a needle (rotateimg). I need to show the readings on the meter by pointing the needle to the reading value. It should rotate on a point ie, the center of the hygrometer image</p>
  
  <p>I tried this code.</p>
  
  <pre><code>[[rotateimg layer]setAnchorPoint:CGPointMake(0.5,0.25)];
      [UIView animateWithDuration:0.0 animations:^{
          [rotateimg setTransform:CGAffineTransformMakeRotation(M_PI*r/180.0)];
      }];
  </code></pre>
  
  <p>but this doesnot work.Here 'r' is the reading value</p>
  
  <p><img src="https://i.stack.imgur.com/ev1op.png" alt="enter image description here">   </p>
  
  <p>this is the output I am getting. It rotates the image but not on a center point.</p>
  
  <p>How to solve this issue please help</p>