Q:

same image but getting different size when installing the app in simulator and device,AFNetWorking

I am doing like following to determine the size of the downloaded image during the block and then i will set the size of the uiimageview accordingly.
self.headerView is an outlet connection to uiimageview in the xib
  __weak  UIImageView *weakObj    =   self.headerView;

    [self.headerView setImageWithURLRequest:[NSMutableURLRequest requestWithURL:[NSURL URLWithString:fundraiserInfo.imageUrl]]
                           placeholderImage:nil
                                    success:^(NSURLRequest *request, NSHTTPURLResponse *response, UIImage *image) {
                                        NSLog(@"image is %@",NSStringFromCGSize(image.size));

                                        CGRect newFrame ;
                                        newFrame                    =   weakObj.frame;
                                        newFrame.size.width         =   image.size.width;
                                        newFrame.size.height        =   image.size.height;
                                        weakObj.frame               =   newFrame;

                                    }
                                    failure:^(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error) {
                                        ;
                                    }
     ];

However, when running the app on the simulator (Device-Iphone), iam getting
image is {300, 222}

However, If I am using simulator (Retina 3.5) or (Retina 4) or I install the app on iphone4 or iphone 5, I am getting :
image is {150, 111}

Why it happens like that.

A:

Its because the image you're downloading isn't identified as a 'retina' image, so on retina devices it will appear as half the size it's actual pixels are.  You can specify an image as retina by reading in an image who's filename is 'filenam@2x.jpg' or you can specify a UIImage's 'scale' value at the time of creation as 1.0 (non-retina) or 2.0 (retina)
[UIImage imageWithData:scale:]
[UIImage imageWithCGImage:scale:orientation:]

If you don't provide a scale value its assumed the image is the appropriate resolution as you've discovered.

