2016-11-24 51 views
0

在你说“这是一个问题的重复”之前,没有。我之前检查过这个问题,它告诉我的是检查我的网点。我所有的网点都是正确的,我不知道为什么我会收到此错误。下面是详细的错误:Swift:用NSExeption未捕获的异常终止应用程序?

*** Terminating app due to uncaught exception  'NSInvalidArgumentException', reason: '-[NSTaggedPointerString objectForKeyedSubscript:]: unrecognized selector sent to instance 0xa00000000006e652' 
*** First throw call stack: 
(
0 CoreFoundation      0x000000010ddf5d4b __exceptionPreprocess + 171 
1 libobjc.A.dylib      0x000000010d85e21e objc_exception_throw + 48 
2 CoreFoundation      0x000000010de65f04 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132 
3 CoreFoundation      0x000000010dd7b005 ___forwarding___ + 1013 
4 CoreFoundation      0x000000010dd7ab88 _CF_forwarding_prep_0 + 120 
5 Calc        0x0000000108d00b37 -[MPCoreInstanceProvider appTransportSecuritySettings] + 284 
6 Calc        0x0000000108cc4147 +[MPAdServerURLBuilder queryParameterForAppTransportSecurity] + 76 
7 Calc        0x0000000108cc30d4 +[MPAdServerURLBuilder URLWithAdUnitID:keywords:location:versionParameterName:version:testing:desiredAssets:adSequence:] + 1674 
8 Calc        0x0000000108cc2a01 +[MPAdServerURLBuilder URLWithAdUnitID:keywords:location:versionParameterName:version:testing:desiredAssets:] + 173 
9 Calc        0x0000000108cc2920 +[MPAdServerURLBuilder URLWithAdUnitID:keywords:location:testing:] + 116 
10 Calc        0x0000000108cd3cde -[MPBannerAdManager loadAdWithURL:] + 470 
11 Calc        0x0000000108cc03a2 -[MPAdView loadAd] + 48 
12 Calc        0x000000010895aa1f _TFFC4Calc18MenuViewController11viewDidLoadFT_T_L_7loadAdsfT_T_ + 175 
13 Calc        0x0000000108957d18 _TFC4Calc18MenuViewController11viewDidLoadfT_T_ + 8104 
14 Calc        0x000000010895b632 _TToFC4Calc18MenuViewController11viewDidLoadfT_T_ + 34 
15 UIKit        0x00000001099cb8b1 -[UIViewController loadViewIfRequired] + 1258 
16 UIKit        0x00000001099cbce4 -[UIViewController view] + 27 
17 UIKit        0x0000000109895405 -[UIWindow addRootViewControllerViewIfPossible] + 71 
18 UIKit        0x0000000109895b56 -[UIWindow _setHidden:forced:] + 293 
19 UIKit        0x00000001098a9469 -[UIWindow makeKeyAndVisible] + 42 
20 Calc        0x0000000108c32264 _TFC4Calc11AppDelegate11applicationfTCSo13UIApplication29didFinishLaunchingWithOptionsGSqGVs10DictionaryVSC29UIApplicationLaunchOptionsKeyP____Sb + 5716 
21 Calc        0x0000000108c34674 _TToFC4Calc11AppDelegate11applicationfTCSo13UIApplication29didFinishLaunchingWithOptionsGSqGVs10DictionaryVSC29UIApplicationLaunchOptionsKeyP____Sb + 180 
22 UIKit        0x0000000109820312 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 290 
23 UIKit        0x0000000109821c97 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 4236 
24 UIKit        0x000000010982803d -[UIApplication _runWithMainScene:transitionContext:completion:] + 1731 
25 UIKit        0x00000001098251bd -[UIApplication workspaceDidEndTransaction:] + 188 
26 FrontBoardServices     0x00000001160176cb __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 24 
27 FrontBoardServices     0x0000000116017544 -[FBSSerialQueue _performNext] + 189 
28 FrontBoardServices     0x00000001160178cd -[FBSSerialQueue _performNextFromRunLoopSource] + 45 
29 CoreFoundation      0x000000010dd9a761 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17 
30 CoreFoundation      0x000000010dd7f98c __CFRunLoopDoSources0 + 556 
31 CoreFoundation      0x000000010dd7ee76 __CFRunLoopRun + 918 
32 CoreFoundation      0x000000010dd7e884 CFRunLoopRunSpecific + 420 
33 UIKit        0x0000000109823a3a -[UIApplication _run] + 434 
34 UIKit        0x0000000109829bb8 UIApplicationMain + 159 
35 Calc        0x0000000108c4617f main + 111 
36 libdyld.dylib      0x0000000110df668d start + 1 
37 ???         0x0000000000000001 0x0 + 1 
) 
libc++abi.dylib: terminating with uncaught exception of type NSException 
(lldb) 
+1

这是一个问题 – hnh

+0

的重复看起来像'你的应用程序的Info.plist'可能没有'NSAppTransportSecurity'或正确的价值观的一个子项 - [MPCoreInstanceProvider.m(https://开头github.com/mopub/mopub-ios-sdk/blob/master/MoPubSDK/Internal/MPCoreInstanceProvider.m) – hnh

+0

让你的答案,它的工作。 –

回答

2

看起来像你的应用程序的Info.plist可能不会有一个适当的值NSAppTransportSecurity或它的一个子。

离店:MPCoreInstanceProvider.m

“这是一个问题重复” - 下一次看你的堆栈跟踪,它包含了所需的所有提示:

  • 关闭顶端你有抛出异常的-[NSObject(NSObject) doesNotRecognizeSelector:]objc_exception_throw ...)
    • doesNotRecognizeSelector意味着一些代码试图调用一个不可
    • 哪一种方法?上面进一步看:-[NSTaggedPointerString objectForKeyedSubscript:]
    • 所以缺少方法是objectForKeyedSubscript:这正是Objective-C的编译器生成像的表达式:该方法是在调用myObject[@"title"]
    • 它也告诉你的类的对象:NSTaggedPointerString,所以一些代码,试图在一个普通的字符串,没有多大意义
  • 检查接下来的事情是谁调用的代码中使用[]-[MPCoreInstanceProvider appTransportSecuritySettings]是在栈上赛季常规代码
    • 所以你DuckDuckGo MPCoreInstanceProvider找到MPCoreInstanceProvider.m
    • 恰好有一个appTransportSecuritySettings方法
    • 寻找到它抓住字典NSDictionary *atsSettingsDictionary = [NSBundle mainBundle].infoDictionary[kMoPubAppTransportSecurityDictionaryKey];
    • ,然后做了很多[]操作上字典和它的价值
    • 代码
  • 结论:其中一个[]正在打字时,它正在期待字典。
+0

您引导我走向正确的道路,但我只需将应用程序传输安全设置的名称更改为应用程序传输设置 –

相关问题