Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error when using MKMapView

I created a single view application with story boards. All I had in my view was MKMapView, thats it. It compiles without errors or warning but when I run it, I get this error in my console window:

<Error>: ImageIO: CGImageReadSessionGetCachedImageBlockData ***   CGImageReadSessionGetCachedImageBlockData: readSession [0x8ab5750] has bad readRef [0x14b79c70]

I'm using Xcode 4.3 and iPhone Simulator 5.1. Any thoughts?

.h File

#import UIKit/UIKit.h
#import CoreLocation/CoreLocation.h
#import MapKit/MapKit.h

@interface WhereamiViewController : UIViewController <CLLocationManagerDelegate, MKMapViewDelegate>
{ 
IBOutlet MKMapView *worldView;
IBOutlet UIActivityIndicatorView *activityIndicator;
IBOutlet UITextField *locationTitleField;
}

@end

.m file

#import "WhereamiViewController.h"

@interface WhereamiViewController ()

@end

@implementation WhereamiViewController

- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}

- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}

@end

enter image description here

like image 604
wackytacky99 Avatar asked Jan 17 '23 02:01

wackytacky99


2 Answers

Just ran into this:

Simple Fix: Make sure to check the box for "shows user location" for the MapView in interface builder.

like image 154
Nadeem Avatar answered Jan 25 '23 07:01

Nadeem


Probably i should not answer a question of almost a year, but i was having the same issue and the cause was that i was calling CLLocationManager *startUpdateLocation* on viewDidLoad method, when i change it to viewWillAppear the issue dissapeared.

like image 29
Vertig0 Avatar answered Jan 25 '23 07:01

Vertig0