title: UIView.center = UIImageView.center but image view doesn't seem to be in centre in landscape
body: <p>I am making application for iPad, only landscape mode will be supported. I am having a <code>UIView</code> and later I am dynamically adding <code>UIImageView</code> as a subview. However my goal is to add images in centre of the <code>UIView</code>. So I used this code,</p>
  
  <pre><code>[imageView setCenter:dynamicMainView.center];
  </code></pre>
  
  <p>where imageView is <code>UIImageView</code>(Obvious :)) and dynamicMainView is <code>UIView</code>, However final outcome docent seem to be in centre,</p>
  
  <p><strong>Visual Representation</strong></p>
  
  <p><img src="https://i.stack.imgur.com/MksXO.png" alt="enter image description here"></p>
  
  <hr />
  
  <p>Full method code for adding UIImageView in UIView is,</p>
  
  <pre><code>-(void) addImageIntoMainDynamicView:(UIImage *) image
  {
      [self clearImageFromMainDynamicView];//Always clear Dynamic main view before adding new views
      imageView = [[UIImageView alloc] initWithImage:image];  
          if(imageView.bounds.size.width &gt; dynamicMainView.bounds.size.width || imageView.bounds.size.height &gt; dynamicMainView.bounds.size.height)
          {
              [imageView setFrame:[dynamicMainView bounds]];
          }
  
          [imageView setCenter:dynamicMainView.center];
          NSLog(@"Image : X = %f and Y = %f", imageView.center.x,imageView.center.y );
          NSLog(@"UIView : X = %f and Y = %f", dynamicMainView.center.x,dynamicMainView.center.y );
          [dynamicMainView addSubview:imageView];
      [imageView release];
  }
  </code></pre>
  
  <p>And above log value is,</p>
  
  <pre><code>2011-12-21 21:07:11.850 Map1TestApp[94645:11603] Image : X = 512.000000 and Y = 371.500000
  2011-12-21 21:07:11.853 Map1TestApp[94645:11603] UIView : X = 512.000000 and Y = 371.500000
  </code></pre>
  
  <p>Any clue about why it's not adding in centre? Am I doing something wrong?</p>
  
  <p><hr />
  <strong>FOR FUTURE VIEWER THE ANWSER WAS :</strong> </p>
  
  <pre><code>[imageView setCenter:CGPointMake(CGRectGetMidX([dynamicMainView bounds]), CGRectGetMidY([dynamicMainView bounds]))];
  </code></pre>