加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ios – 使用MKMapView时出错

发布时间:2020-12-14 18:05:51 所属栏目:百科 来源:网络整理
导读:我用故事板创建了一个单一的视图应用程序.我所看到的只有MKMapView,就是这样.它编译时没有错误或警告,但是当我运行它时,我在控制台窗口中收到此错误: Error: ImageIO: CGImageReadSessionGetCachedImageBlockData *** CGImageReadSessionGetCachedImageBloc
我用故事板创建了一个单一的视图应用程序.我所看到的只有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的“显示用户位置”框.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读