The code for the region looks correct. Are you sure you have linked up the myMapView outlet in interface builder?
If you click and hold on the "File's Owner" object on the left, then hold Ctrl and drag from the File's Owner to the map view in the interface, when you let go of the mouse button you should get the option to set the outlet to myMapView
. You can then see the link in the Connections inspector as shown on the right.
EDIT:
OK, so it appears that, as you are using Autolayout, the map view's frame has not been set by the time viewDidLoad
gets called. I suggest you move it to - (void)viewWillLayoutSubviews
. For example:
- (void)viewWillLayoutSubviews {
[super viewWillLayoutSubviews];
[self setLocation];
}
-(void)setLocation {
// Set region etc...
}