centering a CGRect in a view

UIView's center is a property, not a method.

You need to calculate the actual location you want to put it in. You can do this by setting the frame of the view, or by setting its center, which is simpler in your case.

You don't say what view you then go make imageView a subview of. If you're putting it inside something called superview, you could do this:

CGPoint superCenter = CGPointMake(CGRectGetMidX([superview bounds]), CGRectGetMidY([superview bounds]));
[imageView setCenter:superCenter];

Looking at:

https://developer.apple.com/documentation/coregraphics/cggeometry

You can do:

CGPoint center = CGPointMake(CGRectGetMidX(mainRect), CGRectGetMidY(mainRect));

Position the imageView in the parentView based on the size and origin of the parentView's rect.

Given a parent view named parentView:

float parentRect = parentView.frame;
float imageRect = imageView.frame;

imageRect.origin.x = (int)(parentView.origin.x + (parentRect.size.width - imageRect.size.width) / 2);
imageRect.origin.y = (int)(parentView.origin.y + (parentRect.size.height- imageRect.size.height) / 2);
imageView.frame = imageRect;

Casting the origins to int ensures that your centered image is not blurry (though it may be off center by a subpixel amount).