gpt4 book ai didi

ios - iPhone 6/6+ 上未调用 MKMapSnapshotter 'completionHandler'

转载 作者:行者123 更新时间:2023-11-29 01:36:06 26 4
gpt4 key购买 nike

我正在开发适用于 MKMapSnapshotter API 的应用。
它制作具有所需区域的 map 快照。
它的代码从前台应用程序状态和主线程调用,如下所示:

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 进行了测试。
任何想法 - 如何解决这个问题?

最佳答案

试试这个

__block __strong typeof(self) blockSelf = self

关于ios - iPhone 6/6+ 上未调用 MKMapSnapshotter 'completionHandler',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32951307/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com