Error using MKMapView

I created one application with plugins. All that I had in my opinion was MKMapView, that's all. It compiles without errors or warnings, but when I run it, I get this error in the console window:

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

I am 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

+4
source share
7 answers

Just stumbled upon this:

Simple fix. Be sure to check the "Displays user location" box for MapView in the interface builder.

+5
source

I probably shouldn't answer the question for almost a year, but I had the same problem, and the reason is that I called the CLLocationManager * startUpdateLocation * on the viewDidLoad method, when I change it to viewWillAppear , the problem disappeared.

+3
source

It looks like an error in the structure. Report it to Apple Bug Reporter and find out if this issue is known.

+2
source

My PNG contained some transparent parts, and I think this caused a problem because after deleting these parts the error disappeared. Perhaps I had some error in my PNG files because transparency should be supported.

0
source

I also ran into the same problem. I solved this by commenting out all the code and compiling the program. Then I uncommented each method one by one, compiling after each time. For some reason, this seemed to save me from this mistake.

0
source

Correct ur codes as shown below and create a way out of the map view.

 #import <UIKit/UIKit.h> #import <CoreLocation/CoreLocation.h> #import <MapKit/MapKit.h> 
0
source

Well, I'm doing a much simpler project, so I'm not sure if it will help you. But I will show you my code. You can just start with this and then see if you can build there.

So for ViewController.h it should read ......

 #import <UIKit/UIKit.h> #import <MapKit 
-1
source

All Articles