Tag: mkmapsnapshotter

在iOS7中的MKMapView的快照

我试图在iOS7应用程序中创build一个MKMapView的快照,就像以前的iOS版本推荐的那样: – (UIImage*) renderMapViewToImage { UIGraphicsBeginImageContextWithOptions(mapView.frame.size, NO, 0.0); [mapView.layer renderInContext:UIGraphicsGetCurrentContext()]; UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); return image; } 但是,返回的图像是一个黑色矩形,在其上方有一个蓝色的当前位置点。 我尝试过使用mapView的不同子层,但结果总是相同的。 有谁知道如何在iOS7的MKMapView快照?

iOS上使用MKMapSnapshotter的VectorKit崩溃报告

我得到了与VectorKit和MKMapSnapShotter相关的不同types的崩溃报告。 崩溃发生的相当随机,但似乎是从背景返回时发生的最多。 设备在发生之前不会发出任何内存警告。 这里发生了什么事? 我在用着: if (!_snapshotQueue) { _snapshotQueue = dispatch_queue_create("com.bestappever.snapshot", DISPATCH_QUEUE_SERIAL); } [_snapshotter cancel] _snapshotter = [[MKMapSnapshotter alloc] initWithOptions:options]; __weak __typeof(self)__self = self; [_snapshotter startWithQueue:queue completionHandler:^(MKMapSnapshot *snapshot, NSError *error) { dispatch_async(dispatch_get_main_queue(), ^{ __strong __typeof(__self)_self = __self; [_self doSomething]; }); }]; 最常见的如下: Thread 11 Crashed: 0 libobjc.A.dylib 0x38502b66 objc_msgSend + 5 1 VectorKit 0x35bc8997 -[VKTileProvider […]