ios – 使用MKMapView时出错

前端之家收集整理的这篇文章主要介绍了ios – 使用MKMapView时出错前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我用故事板创建了一个单一的视图应用程序.我所看到的只有MKMapView,就是这样.它编译时没有错误或警告,但是当我运行它时,我在控制台窗口中收到此错误

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

我正在使用Xcode 4.3和iPhone模拟器5.1.有什么想法吗?

.h文件

#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文件

#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

解决方法

刚碰到这个:

简单修复:确保在界面构建器中选中MapView的“显示用户位置”框.

猜你在找的Xcode相关文章