Calling #selector #objc function through perform crasher - swift

I am calling a function through another view controller with:
perform(#selector(MainScreenViewController().test))
The action is called test and it is located in the MainScreenViewController().
Once it reaches this code the application crashes with the following crash report:
2018-01-20 13:24:46.800692+0100 Business Name[40750:3947268] -[Business_Name.RPLabel test]: unrecognized selector sent to instance 0x7fd444d03e30
2018-01-20 13:24:46.809915+0100 Business Name[40750:3947268] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[Business_Name.RPLabel test]: unrecognized selector sent to instance 0x7fd444d03e30'
*** First throw call stack:
(
0 CoreFoundation 0x00000001127621cb __exceptionPreprocess + 171
1 libobjc.A.dylib 0x000000010de9af41 objc_exception_throw + 48
2 CoreFoundation 0x00000001127e2914 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
3 UIKit 0x000000010f5810bd -[UIResponder doesNotRecognizeSelector:] + 295
4 CoreFoundation 0x00000001126e5178 ___forwarding___ + 1432
5 CoreFoundation 0x00000001126e4b58 _CF_forwarding_prep_0 + 120
6 Business Name 0x000000010d54edc2 _T013Business_Name7RPLabelC5setupyyF + 738
7 Business Name 0x000000010d54e705 _T013Business_Name7RPLabelCACSC6CGRectV5frame_tcfc + 325
8 Business Name 0x000000010d54e746 _T013Business_Name7RPLabelCACSC6CGRectV5frame_tcfcTo + 38
9 UIKit 0x000000010f3f3f66 -[UIView init] + 62
10 Business Name 0x000000010d5385a3 _T0So7UILabelCABycfcTO + 19
11 Business Name 0x000000010d53137c _T0So7UILabelCABycfC + 60
12 Business Name 0x000000010d538944 globalinit_33_2857E66F75A5DBE934F5CCD1167A060E_func5 + 20
13 libdispatch.dylib 0x000000011380f43c _dispatch_client_callout + 8
14 libdispatch.dylib 0x00000001138109c7 dispatch_once_f + 297
15 Business Name 0x000000010d538984 _T013Business_Name9mainTitleAA7RPLabelCfau + 36
16 Business Name 0x000000010d5389ae _T013Business_Name10setupTitleyyF + 30
17 Business Name 0x000000010d53fd1f _T013Business_Name24MainScreenViewControllerC13viewDidAppearySbF + 31
18 Business Name 0x000000010d53fe23 _T013Business_Name24MainScreenViewControllerC13viewDidAppearySbFTo + 51
19 UIKit 0x000000010f4fcaaf -[UIViewController _setViewAppearState:isAnimating:] + 699
20 UIKit 0x000000010f55b746 -[UITabBarController viewDidAppear:] + 115
21 UIKit 0x000000010f4fcaaf -[UIViewController _setViewAppearState:isAnimating:] + 699
22 UIKit 0x000000010f4ff959 __64-[UIViewController viewDidMoveToWindow:shouldAppearOrDisappear:]_block_invoke + 42
23 UIKit 0x000000010f4fdc4d -[UIViewController _executeAfterAppearanceBlock] + 86
24 UIKit 0x000000010f364d9d _runAfterCACommitDeferredBlocks + 634
25 UIKit 0x000000010f35330d _cleanUpAfterCAFlushAndRunDeferredBlocks + 280
26 UIKit 0x000000010f374714 __34-[UIApplication _firstCommitBlock]_block_invoke_2 + 155
27 CoreFoundation 0x000000011270520c __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12
28 CoreFoundation 0x00000001126e9a3b __CFRunLoopDoBlocks + 203
29 CoreFoundation 0x00000001126e9214 __CFRunLoopRun + 1300
30 CoreFoundation 0x00000001126e8a89 CFRunLoopRunSpecific + 409
31 GraphicsServices 0x000000011556e9c6 GSEventRunModal + 62
32 UIKit 0x000000010f358d30 UIApplicationMain + 159
33 Business Name 0x000000010d548637 main + 55
34 libdyld.dylib 0x000000011388bd81 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
This is the code in test:
#objc func test(){
print("test")
}

MainScreenViewController().perform(#selector(MainScreenViewController().test))

Related

I'm getting thread error while clicking on login button which should move view to another home view controller but get thread on run time

Not Login
2021-03-21 08:05:13.707070-0700 CarSaleAgent[28101:221025] pushViewController:animated: called on <UINavigationController 0x7fa3ba046800> while an existing transition or presentation is occurring; the navigation stack will not be updated.
Ok
2021-03-21 08:05:19.099331-0700 CarSaleAgent[28101:221025] [MC] System group container for systemgroup.com.apple.configurationprofiles path is /Users/apple/Library/Developer/CoreSimulator/Devices/B81E5794-CC42-4D72-AEC2-9402A99389A8/data/Containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles
2021-03-21 08:05:19.101287-0700 CarSaleAgent[28101:221025] [MC] Reading from private effective user settings.
Login Successfull
2021-03-21 08:05:30.885064-0700 CarSaleAgent[28101:221025] *** Assertion failure in -[UICollectionView _dequeueReusableViewOfKind:withIdentifier:forIndexPath:viewCategory:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKitCore_Sim/UIKit-3698.84.15/UICollectionView.m:5372
2021-03-21 08:05:30.902325-0700 CarSaleAgent[28101:221025] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'could not dequeue a view of kind: UICollectionElementKindCell with identifier homeCollectionViewCell - must register a nib or a class for the identifier or connect a prototype cell in a storyboard'
*** First throw call stack:
(
0 CoreFoundation 0x000000010b46129b __exceptionPreprocess + 331
1 libobjc.A.dylib 0x000000010a9fd735 objc_exception_throw + 48
2 CoreFoundation 0x000000010b461022 +[NSException raise:format:arguments:] + 98
3 Foundation 0x000000010a401b47 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 194
4 UIKitCore 0x00000001105bad1e -[UICollectionView _dequeueReusableViewOfKind:withIdentifier:forIndexPath:viewCategory:] + 2536
5 UIKitCore 0x00000001105bafa9 -[UICollectionView dequeueReusableCellWithReuseIdentifier:forIndexPath:] + 169
6 CarSaleAgent 0x000000010a0a4d99 $S12CarSaleAgent18HomeViewControllerC010collectionE0_13cellForItemAtSo012UICollectionE4CellCSo0lE0C_10Foundation9IndexPathVtF + 345
7 CarSaleAgent 0x000000010a0a501c $S12CarSaleAgent18HomeViewControllerC010collectionE0_13cellForItemAtSo012UICollectionE4CellCSo0lE0C_10Foundation9IndexPathVtFTo + 108
8 UIKitCore 0x00000001105a48f0 -[UICollectionView _createPreparedCellForItemAtIndexPath:withLayoutAttributes:applyAttributes:isFocused:notify:] + 314
9 UIKitCore 0x00000001105a47b0 -[UICollectionView _createPreparedCellForItemAtIndexPath:withLayoutAttributes:applyAttributes:] + 31
10 UIKitCore 0x00000001105a9e67 -[UICollectionView _updateVisibleCellsNow:] + 6164
11 UIKitCore 0x00000001105af68e -[UICollectionView layoutSubviews] + 364
12 UIKitCore 0x0000000110c16015 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1441
13 QuartzCore 0x000000011253ad3d -[CALayer layoutSublayers] + 175
14 QuartzCore 0x000000011253fbf7 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 395
15 QuartzCore 0x00000001124b8aa6 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 342
16 QuartzCore 0x00000001124efc2a _ZN2CA11Transaction6commitEv + 576
17 UIKitCore 0x00000001104f6ff9 _UIApplicationFlushRunLoopCATransactionIfTooLate + 165
18 UIKitCore 0x0000000110454090 __handleEventQueueInternal + 6874
19 CoreFoundation 0x000000010b3c4b31 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
20 CoreFoundation 0x000000010b3c43a3 __CFRunLoopDoSources0 + 243
21 CoreFoundation 0x000000010b3bea4f __CFRunLoopRun + 1263
22 CoreFoundation 0x000000010b3be221 CFRunLoopRunSpecific + 625
23 GraphicsServices 0x00000001146b91dd GSEventRunModal + 62
24 UIKitCore 0x00000001104fd115 UIApplicationMain + 140
25 CarSaleAgent 0x000000010a0b36d7 main + 71
26 libdyld.dylib 0x000000010e158551 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

Why app crashes with [NSObject(NSObject) doesNotRecognizeSelector:]?

The app sometimes crashes with [NSObject(NSObject) doesNotRecognizeSelector:], the selector being [UIImageView setImage:].
I captured it by setting an exception breakpoint and the crash happens when setting an UIImageView.image in prepareForReuse of a UICollectionViewCell:
class MyCell: UICollectionViewCell {
var coverImageView = UIImageView()
...
override func prepareForReuse() {
super.prepareForReuse()
coverImageView.image = nil
}
}
The prepareForReuse is called then the cell is instantiated:
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = myCollectionView.dequeueReusableCell(withReuseIdentifier: "myReuseID", for: indexPath) as! MyCell
...
}
Why is that happening?
Also I cannot load the quick look data view for the UIImageView so maybe the object has been released?
The error messages in console are:
2017-01-21 15:56:19.653 MyApp[4873:20387361] -[__NSMallocBlock__ size]: unrecognized selector sent to instance 0x608000880aa0
2017-01-21 15:56:37.697 MyApp[4873:20387361] invalid mode 'kCFRunLoopCommonModes' provided to CFRunLoopRunSpecific - break on _CFRunLoopError_RunCalledWithInvalidMode to debug. This message will only appear once per execution.
2017-01-21 15:56:38.847 MyApp[4873:20617657] [Optimizely Logging]: Successfully saved data file to disk. Code revision is 229
2017-01-21 15:56:42.723 MyApp[4873:20387361] [Optimizely Logging]: (ERROR) NSInvalidArgumentException: Stack Trace:
(
0 CoreFoundation 0x000000010f587d4b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x000000010ef6121e objc_exception_throw + 48
2 CoreFoundation 0x000000010f5f7f04 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
3 CoreFoundation 0x000000010f50d005 ___forwarding___ + 1013
4 CoreFoundation 0x000000010f50cb88 _CF_forwarding_prep_0 + 120
5 UIKit 0x000000010ba5e20f -[UIImageView _updateImageViewForOldImage:newImage:] + 297
6 UIKit 0x000000010ba59950 -[UIImageView setImage:] + 391
7 MyApp 0x000000010945e0d8 _TFC6MyApp23MyCell15prepareForReusefT_T_ + 136
8 MyApp 0x000000010945e112 _TToFC6MyApp23MyCell15prepareForReusefT_T_ + 34
9 UIKit 0x000000010c19aed1 -[UICollectionView _dequeueReusableViewOfKind:withIdentifier:forIndexPath:viewCategory:] + 773
10 UIKit 0x000000010c19b8ea -[UICollectionView dequeueReusableCellWithReuseIdentifier:forIndexPath:] + 169
11 MyApp 0x00000001095bdee2 _TFC6MyApp23MyViewController14collectionViewfTCSo16UICollectionView13cellForItemAtV10Foundation9IndexPath_CSo20UICollectionViewCell + 594
12 MyApp 0x00000001095be747 _TToFC6MyApp23MyViewController14collectionViewfTCSo16UICollectionView13cellForItemAtV10Foundation9IndexPath_CSo20UICollectionViewCell + 87
13 UIKit 0x000000010c18675f -[UICollectionView _createPreparedCellForItemAtIndexPath:withLayoutAttributes:applyAttributes:isFocused:notify:] + 467
14 UIKit 0x000000010c186586 -[UICollectionView _createPreparedCellForItemAtIndexPath:withLayoutAttributes:applyAttributes:] + 35
15 UIKit 0x000000010c18ba5e -[UICollectionView _updateVisibleCellsNow:] + 4803
16 UIKit 0x000000010c191725 -[UICollectionView layoutSubviews] + 313
17 UIKit 0x000000010b90dab8 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1237
18 QuartzCore 0x000000010d558bf8 -[CALayer layoutSublayers] + 146
19 QuartzCore 0x000000010d54c440 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 366
20 QuartzCore 0x000000010d54c2be _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 24
21 QuartzCore 0x000000010d4da318 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 280
22 QuartzCore 0x000000010d5073ff _ZN2CA11Transaction6commitEv + 475
23 QuartzCore 0x000000010d507d6f _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 113
24 CoreFoundation 0x000000010f52c267 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
25 CoreFoundation 0x000000010f52c1d7 __CFRunLoopDoObservers + 391
26 CoreFoundation 0x000000010f510f8e __CFRunLoopRun + 1198
27 CoreFoundation 0x000000010f510884 CFRunLoopRunSpecific + 420
28 GraphicsServices 0x0000000112b77a6f GSEventRunModal + 161
29 UIKit 0x000000010b848c68 UIApplicationMain + 159
30 MyApp 0x00000001092f5a7f main + 111
31 libdyld.dylib 0x00000001115b568d start + 1
)
2017-01-21 15:56:42.725 MyApp[4873:20387361] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSMallocBlock__ size]: unrecognized selector sent to instance 0x608000880aa0'
*** First throw call stack:
(
0 CoreFoundation 0x000000010f587d4b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x000000010ef6121e objc_exception_throw + 48
2 CoreFoundation 0x000000010f5f7f04 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
3 CoreFoundation 0x000000010f50d005 ___forwarding___ + 1013
4 CoreFoundation 0x000000010f50cb88 _CF_forwarding_prep_0 + 120
5 UIKit 0x000000010ba5e20f -[UIImageView _updateImageViewForOldImage:newImage:] + 297
6 UIKit 0x000000010ba59950 -[UIImageView setImage:] + 391
7 MyApp 0x000000010945e0d8 _TFC6MyApp23MyCell15prepareForReusefT_T_ + 136
8 MyApp 0x000000010945e112 _TToFC6MyApp23MyCell15prepareForReusefT_T_ + 34
9 UIKit 0x000000010c19aed1 -[UICollectionView _dequeueReusableViewOfKind:withIdentifier:forIndexPath:viewCategory:] + 773
10 UIKit 0x000000010c19b8ea -[UICollectionView dequeueReusableCellWithReuseIdentifier:forIndexPath:] + 169
11 MyApp 0x00000001095bdee2 _TFC6MyApp23MyViewController14collectionViewfTCSo16UICollectionView13cellForItemAtV10Foundation9IndexPath_CSo20UICollectionViewCell + 594
12 MyApp 0x00000001095be747 _TToFC6MyApp23MyViewController14collectionViewfTCSo16UICollectionView13cellForItemAtV10Foundation9IndexPath_CSo20UICollectionViewCell + 87
13 UIKit 0x000000010c18675f -[UICollectionView _createPreparedCellForItemAtIndexPath:withLayoutAttributes:applyAttributes:isFocused:notify:] + 467
14 UIKit 0x000000010c186586 -[UICollectionView _createPreparedCellForItemAtIndexPath:withLayoutAttributes:applyAttributes:] + 35
15 UIKit 0x000000010c18ba5e -[UICollectionView _updateVisibleCellsNow:] + 4803
16 UIKit 0x000000010c191725 -[UICollectionView layoutSubviews] + 313
17 UIKit 0x000000010b90dab8 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1237
18 QuartzCore 0x000000010d558bf8 -[CALayer layoutSublayers] + 146
19 QuartzCore 0x000000010d54c440 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 366
20 QuartzCore 0x000000010d54c2be _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 24
21 QuartzCore 0x000000010d4da318 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 280
22 QuartzCore 0x000000010d5073ff _ZN2CA11Transaction6commitEv + 475
23 QuartzCore 0x000000010d507d6f _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 113
24 CoreFoundation 0x000000010f52c267 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
25 CoreFoundation 0x000000010f52c1d7 __CFRunLoopDoObservers + 391
26 CoreFoundation 0x000000010f510f8e __CFRunLoopRun + 1198
27 CoreFoundation 0x000000010f510884 CFRunLoopRunSpecific + 420
28 GraphicsServices 0x0000000112b77a6f GSEventRunModal + 161
29 UIKit 0x000000010b848c68 UIApplicationMain + 159
30 MyApp 0x00000001092f5a7f main + 111
31 libdyld.dylib 0x00000001115b568d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
I think the problem is that you are not calling the designated initializer of UIImageView, therefore its image property is not properly initialized and trying to assign to it crashes the app:
-[NSMallocBlock size]: unrecognized selector sent to instance 0x608000880aa0
The method tries to call the size method on the old image but the old image was set to some random memory address.
To fix it, initialize UIImageView properly using the designated initializer:
var coverImageView = UIImageView(image: nil)

Swift : Terminating app with uncaught exception of NSExeption?

Before you say "this is a repeat of a question", no. I have checked the question before and all it tells me is to check my outlets. All my outlets are correct and I'm not sure why I'm getting this error. Here's the error in detail :
*** 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)
Looks like the Info.plist of your app may not have a proper values for NSAppTransportSecurity or one of its children.
Check out: MPCoreInstanceProvider.m.
"this is a repeat of a question" - next time look at your stack trace, it contains all the hints required:
Close to the top you have the -[NSObject(NSObject) doesNotRecognizeSelector:] which is throwing the exception (objc_exception_throw ...)
doesNotRecognizeSelector means that some code tried to invoke a method which is not available
which one? Look further above: -[NSTaggedPointerString objectForKeyedSubscript:]
so the method missing is objectForKeyedSubscript: which is what the Objective-C compiler generates for an expression like: myObject[#"title"]
it also tells you the class of the object the method is invoked on: NSTaggedPointerString, so some code tried to use [] on a plain string, which doesn't make much sense
Next thing to check is who invoked that code: -[MPCoreInstanceProvider appTransportSecuritySettings] is the last regular code in the stack
so you DuckDuckGo MPCoreInstanceProvider and find MPCoreInstanceProvider.m
which happens to have a appTransportSecuritySettings method
looking into the code it grabs a dictionary NSDictionary *atsSettingsDictionary = [NSBundle mainBundle].infoDictionary[kMoPubAppTransportSecurityDictionaryKey];
and then does a lot of [] operations on that dictionary and values of it
Conclusion: One of the [] is hitting a string when it was expecting a dictionary.

SIGABRT Error swift

Could anyone help me understand why Im getting this error? It seems to be happening when I load one of my view controllers but I can't see why.
What usually causes an error like this?
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UITextInputTraits length]: unrecognized selector sent to instance 0x7fbf924828a0'
*** First throw call stack:
(
0 CoreFoundation 0x000000010664ac65 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000105f27bb7 objc_exception_throw + 45
2 CoreFoundation 0x00000001066520ad -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x00000001065a813c ___forwarding___ + 988
4 CoreFoundation 0x00000001065a7cd8 _CF_forwarding_prep_0 + 120
5 libswiftCore.dylib 0x0000000107ddf728 _TTSf4g_d___TFSSCfMSSFT12_cocoaStringPSs9AnyObject__SS + 120
6 libswiftCore.dylib 0x0000000107dc01a3 _TFSSCfMSSFT12_cocoaStringPSs9AnyObject__SS + 19
7 Project1 0x00000001054ec3bd _TToFC8ASA_Rank22SettingsViewControllers9ASANumberSS + 61
8 Foundation 0x0000000105abdb53 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 259
9 CoreFoundation 0x0000000106592d50 -[NSArray makeObjectsPerformSelector:] + 224
10 UIKit 0x0000000106d1b4eb -[UINib instantiateWithOwner:options:] + 1506
11 UIKit 0x0000000106b736d8 -[UIViewController _loadViewFromNibNamed:bundle:] + 242
12 UIKit 0x0000000106b73cc8 -[UIViewController loadView] + 109
13 UIKit 0x0000000106b73f39 -[UIViewController loadViewIfRequired] + 75
14 UIKit 0x0000000106b743ce -[UIViewController view] + 27
15 UIKit 0x000000010710132d -[_UIFullscreenPresentationController _setPresentedViewController:] + 65
16 UIKit 0x0000000106b4ed69 -[UIPresentationController initWithPresentedViewController:presentingViewController:] + 105
17 UIKit 0x0000000106b80248 -[UIViewController _presentViewController:withAnimationController:completion:] + 1761
18 UIKit 0x0000000106b826c1 __62-[UIViewController presentViewController:animated:completion:]_block_invoke + 132
19 UIKit 0x0000000106b825e5 -[UIViewController presentViewController:animated:completion:] + 229
20 UIKit 0x0000000106a44d62 -[UIApplication sendAction:to:from:forEvent:] + 75
21 UIKit 0x0000000106b5650a -[UIControl _sendActionsForEvents:withEvent:] + 467
22 UIKit 0x0000000106b558d9 -[UIControl touchesEnded:withEvent:] + 522
23 UIKit 0x0000000106a91958 -[UIWindow _sendTouchesForEvent:] + 735
24 UIKit 0x0000000106a92282 -[UIWindow sendEvent:] + 682
25 UIKit 0x0000000106a58541 -[UIApplication sendEvent:] + 246
26 UIKit 0x0000000106a65cdc _UIApplicationHandleEventFromQueueEvent + 18265
27 UIKit 0x0000000106a4059c _UIApplicationHandleEventQueue + 2066
28 CoreFoundation 0x000000010657e431 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
29 CoreFoundation 0x00000001065742fd __CFRunLoopDoSources0 + 269
30 CoreFoundation 0x0000000106573934 __CFRunLoopRun + 868
31 CoreFoundation 0x0000000106573366 CFRunLoopRunSpecific + 470
32 GraphicsServices 0x000000010a1e0a3e GSEventRunModal + 161
33 UIKit 0x0000000106a438c0 UIApplicationMain + 1282
34 Project1 0x00000001054f70c7 main + 135
35 libdyld.dylib 0x0000000108530145 start + 1
36 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Please ask for any other informations that is helpful
Thanks
You most likely have an Outlet assigned to an element on the view controller you are transitioning to that is no longer connected to your code. This youtube video explains it in more detail.
To hunt down this issue, try right-clicking on all your elements (UILabels, UIViews, UIButton...) with the assistant editor open and cross check to see if the outlet name is referenced in the view controller.

[GADSlot state]: unrecognized selector sent to instance

I have integrated AdMob into My Application. Now when i am pushing to the AdMob view it constantly gets crashed.
Here is the Crash log :
2014-04-03 17:56:40.134 myApp[2934:a0b] -[GADSlot state]: unrecognized selector sent to instance 0x1133f700
2014-04-03 17:56:44.047 myApp[2934:a0b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[GADSlot state]: unrecognized selector sent to instance 0x1133f700'
*** First throw call stack:
(
0 CoreFoundation 0x050955e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x028998b6 objc_exception_throw + 44
2 CoreFoundation 0x05132903 -[NSObject(NSObject) doesNotRecognizeSelector:] + 275
3 CoreFoundation 0x0508590b ___forwarding___ + 1019
4 CoreFoundation 0x050854ee _CF_forwarding_prep_0 + 14
5 myApp 0x0004a2ce -[GADSlot isMakingRequest] + 36
6 myApp 0x00049f2d -[GADSlot setAdType:andReloadRequest:] + 334
7 myApp 0x00048d0e -[GADBannerView setAdSize:andReload:] + 512
8 myApp 0x00049302 -[GADBannerView setAdSize:] + 62
9 myApp 0x0004957c -[GADBannerView initWithFrame:] + 172
10 myApp 0x00008822 -[JustStartVC viewDidLoad] + 18242
11 UIKit 0x015129a8 -[UIViewController loadViewIfRequired] + 696
12 UIKit 0x01512c44 -[UIViewController view] + 35
13 UIKit 0x0152ca72 -[UINavigationController _startCustomTransition:] + 778
14 UIKit 0x01539757 -[UINavigationController _startDeferredTransitionIfNeeded:] + 688
15 UIKit 0x0153a349 -[UINavigationController __viewWillLayoutSubviews] + 57
16 UIKit 0x0167339d -[UILayoutContainerView layoutSubviews] + 213
17 UIKit 0x01469dd7 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 355
18 libobjc.A.dylib 0x028ab81f -[NSObject performSelector:withObject:] + 70
19 QuartzCore 0x012d972a -[CALayer layoutSublayers] + 148
20 QuartzCore 0x012cd514 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 380
21 QuartzCore 0x012cd380 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 26
22 QuartzCore 0x01235156 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 294
23 QuartzCore 0x012364e1 _ZN2CA11Transaction6commitEv + 393
24 QuartzCore 0x01236bb4 _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 92
25 CoreFoundation 0x0505d53e __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 30
26 CoreFoundation 0x0505d48f __CFRunLoopDoObservers + 399
27 CoreFoundation 0x0503b3b4 __CFRunLoopRun + 1076
28 CoreFoundation 0x0503ab33 CFRunLoopRunSpecific + 467
29 CoreFoundation 0x0503a94b CFRunLoopRunInMode + 123
30 GraphicsServices 0x02a999d7 GSEventRunModal + 192
31 GraphicsServices 0x02a997fe GSEventRun + 104
32 UIKit 0x013ff94b UIApplicationMain + 1225
33 myApp 0x00016b2d main + 141
34 libdyld.dylib 0x056b9725 start + 0
35 ??? 0x00000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Thanks.
Go to project settings > Build Settings And set -ObjC to Other Linker Flags.
More info: https://stackoverflow.com/a/22585112/2115477
I referred few discussions & found that there is an flag need to be added in build settings.
Here it is :
Targets -> Build Settings -> Linking -> Other Linker Flags
I set here -ObjC
So now its working.