FBNativeAdsManager nextNativeAd()在第一个单元格时崩溃

时间:2016-01-06 08:16:30

标签: ios swift facebook facebook-audience-network

如果单元格是第一个

,则代码在以下行中崩溃
$("#register_to_buy_card").submit(function (event) {
    event.preventDefault();
    var $this = $(this);
    var url = $this.attr('action');
    var formData = new FormData(this);
    $.ajax({
        url: url,
        type: "POST",
        dataType: "json",
        data: formData,
        contentType:false,
        processData:false,
        success: function (data) {

        },
        error: function (data) {

        }
    });
});

我猜广告还没有准备就绪。但是不应该崩溃!我尝试把它放在do-try-catch中,但它没有帮助。

let nativeAdd = nativeAdsManager.nextNativeAd() as FBNativeAd?

1 个答案:

答案 0 :(得分:0)

我有类似的问题,在点击广告时很少崩溃(位于my app的第5个单元格中,使用带有CocoaPods的FBAudienceNetwork iOS SDK 4.26.0)

致命异常:NSInvalidArgumentException - [FullScreenCatalogViewController nativeAdDidClick:]:无法识别的选择器发送到实例0x161ff12d0

Fatal Exception: NSInvalidArgumentException
0  CoreFoundation                 0x185dabd38 __exceptionPreprocess
1  libobjc.A.dylib                0x1852c0528 objc_exception_throw
2  CoreFoundation                 0x185db91f8 __methodDescriptionForSelector
3  UIKit                          0x18f573cc4 -[UIResponder doesNotRecognizeSelector:]
4  CoreFoundation                 0x185db13f0 ___forwarding___
5  CoreFoundation                 0x185c970dc _CF_forwarding_prep_0
6  Black Friday                   0x100f446e0 __33-[FBMediaView loadMultiProductAd]_block_invoke_2 (FBMediaView.m:447)
7  Black Friday                   0x100f5f9f0 -[FBAdCommandProcessor callCompletionHandlerForCommand:withAdAction:] (FBAdCommandProcessor.m:296)
8  Black Friday                   0x100f5f938 -[FBAdCommandProcessor launchURLOutOfApp:withAdAction:] (FBAdCommandProcessor.m:283)
9  Black Friday                   0x100f5ec84 -[FBAdCommandProcessor launchAppForEngagement:] (FBAdCommandProcessor.m:164)
10 Black Friday                   0x100f5ea2c -[FBAdCommandProcessor processCommand:withExtraData:adDataModel:completionHandler:] (FBAdCommandProcessor.m:142)
11 Black Friday                   0x100f444d0 __33-[FBMediaView loadMultiProductAd]_block_invoke.218 (FBMediaView.m:439)
12 Black Friday                   0x100f84540 -[FBAdMultiProductView multiProductCellClicked:withPosition:inRect:] (FBAdMultiProductView.m:115)
13 Black Friday                   0x100f83b28 -[FBAdMultiProductCell dispatchClickedWithPosition:inRect:] (FBAdMultiProductCell.m:151)
14 Black Friday                   0x100f839f0 -[FBAdMultiProductCell gestureRecognizerTappedCell:] (FBAdMultiProductCell.m:129)
15 UIKit                          0x18f848f78 -[UIGestureRecognizerTarget _sendActionWithGestureRecognizer:]
16 UIKit                          0x18f84d4dc _UIGestureRecognizerSendTargetActions
17 UIKit                          0x18f337dc8 _UIGestureRecognizerSendActions
18 UIKit                          0x18f1ec748 -[UIGestureRecognizer _updateGestureWithEvent:buttonEvent:]
19 UIKit                          0x18f8373fc _UIGestureEnvironmentUpdate
20 UIKit                          0x18f836f88 -[UIGestureEnvironment _deliverEvent:toGestureRecognizers:usingBlock:]
21 UIKit                          0x18f8360e4 -[UIGestureEnvironment _updateGesturesForEvent:window:]
22 UIKit                          0x18f1eaa54 -[UIWindow sendEvent:]
23 UIKit                          0x18f1bc078 -[UIApplication sendEvent:]
24 UIKit                          0x18fafbf98 __dispatchPreprocessedEventFromEventQueue
25 UIKit                          0x18fafe408 __handleEventQueueInternal
26 UIKit                          0x18faf7574 __handleHIDEventFetcherDrain
27 CoreFoundation                 0x185d54358 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
28 CoreFoundation                 0x185d542d8 __CFRunLoopDoSource0
29 CoreFoundation                 0x185d53b60 __CFRunLoopDoSources0
30 CoreFoundation                 0x185d51738 __CFRunLoopRun
31 CoreFoundation                 0x185c722d8 CFRunLoopRunSpecific
32 GraphicsServices               0x187b03f84 GSEventRunModal
33 UIKit                          0x18f21f880 UIApplicationMain
34 Black Friday                   0x100e7649c main (main.m:15)
35 libdyld.dylib                  0x18579656c start