小编Jor*_*ijk的帖子

在iOS上使用MKMapSnapshotter的VectorKit崩溃报告

我得到别样的有关崩溃报告VectorKitMKMapSnapShotter.崩溃发生得相当随机,但从背景返回时似乎发生了最多.设备在发生之前不会发出任何内存警告.

这里发生了什么事?

我正在使用:

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];
    });
}];
Run Code Online (Sandbox Code Playgroud)

最常见的一个如下:

Thread 11 Crashed:
0   libobjc.A.dylib                      0x38502b66 objc_msgSend + 5
1   VectorKit                            0x35bc8997 -[VKTileProvider changeTileForKey:toState:withMetadata:withTile:forLayer:] + 51
2   VectorKit                            0x35c1f88d -[VKTileProvider tileSource:invalidateKeys:] + 168
3   VectorKit                            0x35c41325 -[VKTileSource didFailToLoadTileKey:error:] + 196
4   GeoServices                          0x32ca906b ___ZN8LoadItem15deleteRequesterEP8NSStringbb_block_invoke + 87 …
Run Code Online (Sandbox Code Playgroud)

mapkit ios ios7 mkmapsnapshotter

53
推荐指数
1
解决办法
2928
查看次数

iOS 8 NSInternalInconsistencyException

我收到以下崩溃报告.它们仅出现在iOS 8设备上.请注意以下消息:

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'this request has been neutered - you can't call -sendResponse: twice nor after encoding it'
Run Code Online (Sandbox Code Playgroud)

崩溃报告:

Date/Time:       2014-08-31T01:39:15Z
OS Version:      iPhone OS 8.0 (12A4345d)
Report Version:  104

Exception Type:  SIGABRT
Exception Codes: #0 at 0x1964cb270
Crashed Thread:  0

Application Specific Information:
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'this request has been neutered - you can't call -sendResponse: twice nor after encoding it'

Last Exception Backtrace:
0   CoreFoundation …
Run Code Online (Sandbox Code Playgroud)

objective-c crash-reports ios ios8

22
推荐指数
1
解决办法
2万
查看次数

AVAudioSession AVAudioSessionCategoryPlayAndRecord故障

我想使用音频录制视频AVCaptureSession.为此,我需要AudioSessionCategory AVAudioSessionCategoryPlayAndRecord,因为我的应用程序还播放带声音的视频.

我希望从默认扬声器中听到音频,我希望它能与其他音频混音.所以我需要选项AVAudioSessionCategoryOptionDefaultToSpeaker | AVAudioSessionCategoryOptionMixWithOthers.

如果我在播放其他音频时执行以下操作,则其他应用程序的音频中会出现明显的可听故障:

[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayAndRecord withOptions:AVAudioSessionCategoryOptionMixWithOthers | AVAudioSessionCategoryOptionDefaultToSpeaker error:nil];
[[AVAudioSession sharedInstance] setActive:YES error:nil];
Run Code Online (Sandbox Code Playgroud)

有没有办法摆脱这个小故障?

当没有麦克风输入AVAudioSessionRouteChangeReasonRouteConfigurationChange通知AVAudioSessionRouteChangeReasonCategoryChange麦克风输入时,似乎会出现这种情况.

当应用程序进入后台时(无论是否取消激活音频会话),也会发生配置更改(和故障).当从后台返回而不停用音频会话时,当AVCaptureSession配置改变时,即当摄像机从前向后切换时,毛刺开始发生.在这种情况下,不触摸音频路由,并且仅在从后台返回而不停用音频会话时发生.路由更改的通知被触发两次.一旦禁用麦克风,一次再启用它.

请注意,通过下载Apple的AVCamManual示例,可以轻松重现此行为.添加以下到viewDidLoadAAPLCameraViewController.m:

[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayAndRecord withOptions:AVAudioSessionCategoryOptionMixWithOthers | AVAudioSessionCategoryOptionDefaultToSpeaker error:nil];
[[AVAudioSession sharedInstance] setActive:YES error:nil];
…
session.usesApplicationAudioSession = YES;
session.automaticallyConfiguresApplicationAudioSession = NO;
Run Code Online (Sandbox Code Playgroud)

其他一些奇怪的事情,可能是相关的:

将音频类别设置为AVAudioSessionCategoryAmbient第一个并激活它:

[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryAmbient withOptions:0 error:nil];
[[AVAudioSession sharedInstance] setActive:YES error:nil];
Run Code Online (Sandbox Code Playgroud)

然后更改类别:

[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayAndRecord withOptions:AVAudioSessionCategoryOptionMixWithOthers | AVAudioSessionCategoryOptionDefaultToSpeaker error:nil];
Run Code Online (Sandbox Code Playgroud)

尽管有选项标志,其他音频停止播放.没有错误被抛出.

objective-c avfoundation ios avcapturesession avaudiosession

11
推荐指数
1
解决办法
4881
查看次数

没有占位符图像的UITableViewCell中的AlamofireImage af_setImageWithURL

我正在使用AlamofireImage在UITmageView中的UIImageView上设置图像,如下所示:

cell.imageView.af_setImageWithURL(url)

下载后图像不显示.它将从内存缓存中第二次显示图像.

似乎使用占位符图像会产生重大影响.

这适用于打印(下载)图像的地址:

cell.imageView.af_setImageWithURL(URL, placeholderImage: UIImage(named: "placeholder"), filter: nil, imageTransition: .None, completion: { (response) -> Void in
                    print("image: \(cell.imageView.image)")
                })
Run Code Online (Sandbox Code Playgroud)

这不起作用并打印"image:nil"

cell.imageView.af_setImageWithURL(URL, placeholderImage: nil, filter: nil, imageTransition: .None, completion: { (response) -> Void in
                    print("image: \(self.image)")
                })
Run Code Online (Sandbox Code Playgroud)

在执行之前将单元格imageView设置为空图像时也可以 af_setImageWithURL:

cell.imageView.image = UIImage()

这是UITableViewCell,AlamofireImage中的错误还是我做错了什么?

iphone cocoa-touch ios alamofire alamofireimage

11
推荐指数
2
解决办法
6382
查看次数

MKMapView _annotationContainer崩溃

我正在使用MKMapView在iOS模拟器中获得看起来随机发生的崩溃.它不是由任何用户操作触发的,它只是无中生有.我得到以下堆栈跟踪:

<_NSCallStackArray 0x2d9762b0>(
0   ???                                 0x137d69bd 0x0 + 326986173,
1   Foundation                          0x03ca3b0a -[NSObject(NSKeyValueCoding) valueForUndefinedKey:] + 282,
2   Foundation                          0x03c10b61 _NSGetUsingKeyValueGetter + 81,
3   Foundation                          0x03c1019b -[NSObject(NSKeyValueCoding) valueForKey:] + 260,
4   AccessibilityUtilities              0x11ad1a3f -[NSObject(UIAccessibilitySafeCategory) safeValueForKey:] + 43,
5   MapKitFramework                     0x12090aa4 -[MKBasicMapViewAccessibility(SafeCategory) accessibilityContainerElements] + 91,
6   UIAccessibility                     0x11fc7149 -[NSObject(AXPrivCategory) accessibilityElementCount] + 34,
7   UIAccessibility                     0x11fc751f -[NSObject(AXPrivCategory) _accessibilityHasOrderedChildren] + 59,
8   UIKit                               0x11ebb388 -[UIViewAccessibility(SafeCategory) _accessibilitySubviewsForGettingElementsIncludingContainers:includingOpaqueElementProviders:] + 2269,
9   UIKit                               0x11ebba96 -[UIViewAccessibility(SafeCategory) _accessibilityElementsInContainer:topLevel:includeKB:includeOpaqueElementProviders:] + 486,
10  UIKit                               0x11eba12f -[UIViewAccessibility(SafeCategory) _accessibilityElementsInContainer:topLevel:includeKB:] + 64,
11  UIKit …
Run Code Online (Sandbox Code Playgroud)

objective-c mapkit mkmapview ios

5
推荐指数
1
解决办法
395
查看次数