我正在开发与MKMapSnapshotter API一起工作的应用程序。
它用所需的区域制作地图快照。
从前台应用程序状态和主线程调用其代码,如下所示:
MKMapSnapshotOptions* options = [[MKMapSnapshotOptions alloc] init];
options.region = MKCoordinateRegionMake(locationCenter, span);
options.scale = UIScreen.mainScreen.scale;
options.size = size;
__block typeof(self) blockSelf = self;
MKMapSnapshotter* snapshooter = [[MKMapSnapshotter alloc] initWithOptions: options];
[snapshooter startWithCompletionHandler: ^(MKMapSnapshot* snapshot, NSError* error) {
blockSelf.snapshot = snapshot.image;
}];我注意到在iPhone 6和6+完成处理程序上从未调用过,在iOS 8和9上进行了测试。
在iOS模拟器中,一切都按预期工作,用Xcode 7、iOS 8和9进行了测试。
有什么办法-怎么解决?
发布于 2015-10-05 15:02:16
尝尝这个
__block __strong typeof(self) blockSelf = selfhttps://stackoverflow.com/questions/32951307
复制相似问题