Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

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

share|improve this question
 
Can you post the code for your MapKitView? –  mkral Jul 16 '12 at 20:16
 
The code does not have anything other than an Outlet for MKMapView in the header file. #import <UIKit/UIKit.h> #import <CoreLocation/CoreLocation.h> #import <MapKit/MapKit.h> @interface WhereamiViewController : UIViewController <CLLocationManagerDelegate, MKMapViewDelegate> { CLLocationManager *locationManager; IBOutlet MKMapView *worldView; } @end –  wackytacky99 Jul 16 '12 at 22:02
1  
have you tried clearing the derived data? It seems this is a simulator error. Not necessarily with your code –  mkral Jul 17 '12 at 14:27
 
How do I do that? Sorry I'm new to Xcode. –  wackytacky99 Jul 17 '12 at 17:54
 
Go to Organizer (top right of xcode) select Projects then the project you're working on. Then click Delete... next to Derived Data. –  mkral Jul 17 '12 at 17:58
show 13 more comments

7 Answers

up vote 5 down vote accepted

Just ran into this:

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

share|improve this answer
add comment

That looks to me like a bug in the framework. Report it using the Apple Bug Reporter and see if it's a known issue.

share|improve this answer
add comment

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.

share|improve this answer
add comment

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

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

#import <UIKit/UIKit.h>
#import <MapKit
share|improve this answer
2  
Where is your code? –  user577537 Nov 6 '12 at 16:24
 
I just see two lines. Please post your code –  wackytacky99 Nov 6 '12 at 19:42
add comment

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

share|improve this answer
 
This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. –  Leigh Dec 14 '12 at 5:43
 
I get this error without even using any PNG files. –  Legoless May 13 '13 at 17:33
add comment

I also ran into the same problem. I solved it by commenting out all the code and compile the program. Then I uncommented each method one by one compiling after each time. For some reason that seemed to get rid of the error for me.

share|improve this answer
add comment

Correct ur codes as below, and create the outlet of map view.

#import <UIKit/UIKit.h>
#import <CoreLocation/CoreLocation.h>
#import <MapKit/MapKit.h>
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.