title: how to align my image in the center IOS horizontally
body: <p>Here is my image :</p>
  
  <pre><code>Obj *obj = ... obj has imageHref which is NSString
  
  UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:obj.imageHref]]; 
  [image drawInRect:CGRectMake(0, 0, image.size.width, image.size.height)];
  </code></pre>
  
  <p>Depending on image size I can't figure out how to center it, any ideas ?</p>
  
  <p>This is all inside method :</p>
  
  <pre><code>- (void)drawRect:(CGRect)rect {    
      Obj *obj = ... obj has imageHref which is NSString
  
      UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:obj.imageHref]]; 
      [image drawInRect:CGRectMake(0, 0, image.size.width, image.size.height)];
  
      NSLog(@"%f", rect.size.width);
       NSLog(@"%f", rect.size.height);
  }
  </code></pre>
  
  <p>Where <code>rect.size.width</code> prints 320.000000 and <code>rect.size.height</code> prints 416.000000</p>