I have a custom view with a corresponding xib in a framework. In interface builder, I've set the File's Owner and the view itself to the my subclass of UIView (TotalTokenCountView). I've also setup outlets for two labels in the custom view. However, when I use this custom view in an application, I get an NSUnknownKeyException exception.
I've tried setting the outlet vars to public to ensure that they can be connected outside of the framework, but that didn't work either.
Am I missing something here? Is there more setup I need to do for the outlets to connect?
public class TotalTokenCountView: UIView {
#IBOutlet public weak var tokenLabel: UILabel!
#IBOutlet public weak var tokenCountLabel: UILabel!
public override func awakeFromNib() {
tokenCountLabel.textColor = UIColor.deepPurple
tokenLabel.textColor = UIColor.lavenderGrayMedium
}
static func create() -> TotalTokenCountView {
return mybundle.loadNibNamed("TotalTokenCountView", owner: self, options: nil)!.first! as! TotalTokenCountView
}
}
The code that creates the custom view:
public class TotalTokenCountBarButtonItem: UIBarButtonItem {
public required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
commonInit()
}
private func commonInit() {
self.customView = TotalTokenCountView.create()
}
}
IB Screenshots:
Exception:
*** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<MyFrameworkTarget.TotalTokenCountView 0x104ed9580> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key tokenCountLabel.'
*** First throw call stack:
(
0 CoreFoundation 0x000000010a0d31e6 __exceptionPreprocess + 294
1 libobjc.A.dylib 0x000000010550a031 objc_exception_throw + 48
2 CoreFoundation 0x000000010a0d30b9 -[NSException raise] + 9
3 Foundation 0x0000000104f2bb47 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 292
4 UIKit 0x000000010622fe8a -[UIRuntimeOutletConnection connect] + 109
5 CoreFoundation 0x000000010a075e8d -[NSArray makeObjectsPerformSelector:] + 317
6 UIKit 0x000000010622e834 -[UINib instantiateWithOwner:options:] + 1856
7 MyFrameworkTarget 0x0000000104ed73bf _T012MyFrameworkTarget19TotalTokenCountViewC6createACyFZ + 431
8 MyFrameworkTarget 0x0000000104ed817b _T012MyFrameworkTarget28TotalTokenCountBarButtonItemC10commonInit33_82940FA39F221CEB8A8645FA6323AFBFLLyyF + 43
9 MyFrameworkTarget 0x0000000104ed80bc _T012MyFrameworkTarget28TotalTokenCountBarButtonItemCACSgSo7NSCoderC5coder_tcfc + 124
10 MyFrameworkTarget 0x0000000104ed813f _T012MyFrameworkTarget28TotalTokenCountBarButtonItemCACSgSo7NSCoderC5coder_tcfcTo + 47
11 UIKit 0x000000010622f725 -[UIClassSwapper initWithCoder:] + 246
12 UIKit 0x000000010648188c UINibDecoderDecodeObjectForValue + 704
13 UIKit 0x00000001064815bf -[UINibDecoder decodeObjectForKey:] + 246
14 UIKit 0x000000010671219b -[UINavigationItem initWithCoder:] + 715
15 UIKit 0x000000010648188c UINibDecoderDecodeObjectForValue + 704
16 UIKit 0x00000001064815bf -[UINibDecoder decodeObjectForKey:] + 246
17 UIKit 0x0000000105f44db1 -[UIViewController initWithCoder:] + 407
18 UIKit 0x0000000105fac885 -[UITabBarController initWithCoder:] + 65
19 UIKit 0x000000010648188c UINibDecoderDecodeObjectForValue + 704
20 UIKit 0x0000000106481a2a UINibDecoderDecodeObjectForValue + 1118
21 UIKit 0x00000001064815bf -[UINibDecoder decodeObjectForKey:] + 246
22 UIKit 0x0000000105f451a0 -[UIViewController initWithCoder:] + 1414
23 UIKit 0x0000000105f74dcc -[UINavigationController initWithCoder:] + 65
24 UIKit 0x000000010648188c UINibDecoderDecodeObjectForValue + 704
25 UIKit 0x00000001064815bf -[UINibDecoder decodeObjectForKey:] + 246
26 UIKit 0x000000010622f3f1 -[UIRuntimeConnection initWithCoder:] + 178
27 UIKit 0x000000010648188c UINibDecoderDecodeObjectForValue + 704
28 UIKit 0x0000000106481a2a UINibDecoderDecodeObjectForValue + 1118
29 UIKit 0x00000001064815bf -[UINibDecoder decodeObjectForKey:] + 246
30 UIKit 0x000000010622e5e2 -[UINib instantiateWithOwner:options:] + 1262
31 UIKit 0x00000001066bb406 -[UIStoryboard instantiateViewControllerWithIdentifier:] + 181
32 UIKit 0x0000000105da5862 -[UIApplication _loadMainStoryboardFileNamed:bundle:] + 112
33 UIKit 0x0000000105da5d33 -[UIApplication _loadMainInterfaceFile] + 272
34 UIKit 0x0000000105da44b9 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1403
35 UIKit 0x0000000106166f7e __111-[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:]_block_invoke + 866
36 UIKit 0x0000000106539a39 +[_UICanvas _enqueuePostSettingUpdateTransactionBlock:] + 153
37 UIKit 0x0000000106166bba -[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:] + 236
38 UIKit 0x00000001061673db -[__UICanvasLifecycleMonitor_Compatability activateEventsOnly:withContext:completion:] + 675
39 UIKit 0x0000000106ad8614 __82-[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:]_block_invoke + 299
40 UIKit 0x0000000106ad84ae -[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:] + 433
41 UIKit 0x00000001067bc75d __125-[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:]_block_invoke + 221
42 UIKit 0x00000001069b74b7 _performActionsWithDelayForTransitionContext + 100
43 UIKit 0x00000001067bc627 -[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:] + 223
44 UIKit 0x00000001065390e0 -[_UICanvas scene:didUpdateWithDiff:transitionContext:completion:] + 392
45 UIKit 0x0000000105da2eac -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 515
46 UIKit 0x0000000106375bcb -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 361
47 FrontBoardServices 0x000000010d5752f3 -[FBSSceneImpl _didCreateWithTransitionContext:completion:] + 331
48 FrontBoardServices 0x000000010d57dcfa __56-[FBSWorkspace client:handleCreateScene:withCompletion:]_block_invoke_2 + 225
49 libdispatch.dylib 0x00000001089c97ec _dispatch_client_callout + 8
50 libdispatch.dylib 0x00000001089cedb8 _dispatch_block_invoke_direct + 592
51 FrontBoardServices 0x000000010d5a9470 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 24
52 FrontBoardServices 0x000000010d5a912e -[FBSSerialQueue _performNext] + 439
53 FrontBoardServices 0x000000010d5a968e -[FBSSerialQueue _performNextFromRunLoopSource] + 45
54 CoreFoundation 0x000000010a075bb1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
55 CoreFoundation 0x000000010a05a4af __CFRunLoopDoSources0 + 271
56 CoreFoundation 0x000000010a059a6f __CFRunLoopRun + 1263
57 CoreFoundation 0x000000010a05930b CFRunLoopRunSpecific + 635
58 GraphicsServices 0x000000010cdc9a73 GSEventRunModal + 62
59 UIKit 0x0000000105da6057 UIApplicationMain + 159
60 PinataApp 0x0000000104be62c7 main + 55
61 libdyld.dylib 0x0000000108a46955 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Remove the references (outlets) from File's Owner and add them to TotalTokenCountView.
Not sure if this is causing your problem, but in your call to loadNibNamed, you're passing self as owner. Since you're in a static method, that's a reference to the class type, not an instance.
Related
Everything was working fine on xcode 7.3.1, Than I have to add braintree 3ds sdk which is supported on xcode 8. So, I migrated the code to xcode 8 and than xcode 9. Now, build working fine on below IOS 11 but on ios 11 and above app is crashing before opening new main screen. I am new to Ios please help.
it's crashing on this line :
let vc = storyboard?.instantiateViewController(withIdentifier: "KbNav") as! KabNavigationController
2018-08-30 12:25:52.730641+0500 Kab[2970:32711] *** Assertion failure in
-[_UINavigationBarVisualProviderModernIOS _contentViewFittingHeight],
/BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit_Sim/UIKit-
3698.33.6/_UINavigationBarVisualProviderModernIOS.m:569
2018-08-30 12:25:52.769549+0500 Kab[2970:32711] *** Terminating app due
to uncaught exception 'NSInternalInconsistencyException', reason: 'Sigh.
Contentview size is zero.'
*** First throw call stack:
(
0 CoreFoundation 0x0000000115da712b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x0000000114d50f41 objc_exception_throw + 48
2 CoreFoundation 0x0000000115dac2f2 +[NSException raise:format:arguments:] + 98
3 Foundation 0x00000001147f1d69 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 193
4 UIKit 0x00000001131382f5 -[_UINavigationBarVisualProviderModernIOS _contentViewFittingHeight] + 265
5 UIKit 0x0000000112eb65e0 -[UINavigationItem _desiredHeightForBarMetrics:defaultHeightBlock:] + 90
6 UIKit 0x000000011313afa1 -[_UINavigationBarVisualProviderModernIOS heightRangeFittingWidth:] + 412
7 UIKit 0x000000011264a0ed -[UINavigationBar _heightRangeForNavigationItem:fittingWidth:] + 210
8 UIKit 0x0000000112726a98 -[UINavigationController _intrinsicNavigationBarHeightRangeForViewController:] + 187
9 UIKit 0x00000001127269b6 -[UINavigationController _preferredHeightForHidingNavigationBarForViewController:] + 628
10 UIKit 0x000000011271688f -[UINavigationController _positionNavigationBarHidden:edge:initialOffset:] + 356
11 UIKit 0x0000000112716cf8 -[UINavigationController _positionNavigationBarHidden:edge:] + 388
12 UIKit 0x000000011271e555 -[UINavigationController loadView] + 243
13 UIKit 0x00000001126e105c -[UIViewController loadViewIfRequired] + 195
14 UIKit 0x00000001126e18b9 -[UIViewController view] + 27
15 Kab 0x000000010f00faea -[SlideNavigationController setEnableShadow:] + 74
16 Kab 0x000000010f00d494 -[SlideNavigationController setup] + 244
17 Kab 0x000000010f00d1d1 -[SlideNavigationController initWithCoder:] + 145
18 Kab 0x000000010f20e1d6 _T08Kab0A20NavigationControllerCACSgSo7NSCoderC5coder_tcfc + 214
19 Kab 0x000000010f20e29f _T08Kab0A20NavigationControllerCACSgSo7NSCoderC5coder_tcfcTo + 47
20 UIKit 0x00000001129ca4c8 -[UIClassSwapper initWithCoder:] + 246
21 UIKit 0x0000000112c1f109 UINibDecoderDecodeObjectForValue + 704
22 UIKit 0x0000000112c1ee3e -[UINibDecoder decodeObjectForKey:] + 89
23 UIKit 0x000000011264675a -[UINavigationBar initWithCoder:] + 753
24 UIKit 0x0000000112c1f109 UINibDecoderDecodeObjectForValue + 704
25 UIKit 0x0000000112c1ee3e -[UINibDecoder decodeObjectForKey:] + 89
26 UIKit 0x0000000112eb15f2 -[UINavigationItem initWithCoder:] + 1018
27 UIKit 0x0000000112c1f109 UINibDecoderDecodeObjectForValue + 704
28 UIKit 0x0000000112c1ee3e -[UINibDecoder decodeObjectForKey:] + 89
29 UIKit 0x00000001126dc053 -[UIViewController initWithCoder:] + 432
30 Kab 0x000000010f29a6a8 _T08Kab18HomeViewControllerCACSgSo7NSCoderC5coder_tcfc + 7704
31 Kab 0x000000010f29a77f _T08Kab18HomeViewControllerCACSgSo7NSCoderC5coder_tcfcTo + 47
32 UIKit 0x00000001129ca4c8 -[UIClassSwapper initWithCoder:] + 246
33 UIKit 0x0000000112c1f109 UINibDecoderDecodeObjectForValue + 704
34 UIKit 0x0000000112c1ee3e -[UINibDecoder decodeObjectForKey:] + 89
35 UIKit 0x00000001129ca194 -[UIRuntimeConnection initWithCoder:] + 178
36 UIKit 0x00000001129ca8d0 -[UIRuntimeEventConnection initWithCoder:] + 59
37 UIKit 0x0000000112c1f109 UINibDecoderDecodeObjectForValue + 704
38 UIKit 0x0000000112c1f2a7 UINibDecoderDecodeObjectForValue + 1118
39 UIKit 0x0000000112c1ee3e -[UINibDecoder decodeObjectForKey:] + 89
40 UIKit 0x00000001129c9391 -[UINib instantiateWithOwner:options:] + 1262
41 UIKit 0x0000000112e59fc2 -[UIStoryboard instantiateViewControllerWithIdentifier:] + 181
42 Kab 0x000000010f135a7b _T08Kabr24LaunchTourViewControllerC4skipyyXlF + 219
43 Kab 0x000000010f136118 _T08Kab24LaunchTourViewControllerC4skipyyXlFTo + 56
44 UIKit 0x000000011253a972 -[UIApplication sendAction:to:from:forEvent:] + 83
45 UIKit 0x00000001126b9c3c -[UIControl sendAction:to:forEvent:] + 67
46 UIKit 0x00000001126b9f59 -[UIControl _sendActionsForEvents:withEvent:] + 450
47 UIKit 0x00000001126b8e86 -[UIControl touchesEnded:withEvent:] + 618
48 UIKit 0x00000001125b0807 -[UIWindow _sendTouchesForEvent:] + 2807
49 UIKit 0x00000001125b1f2a -[UIWindow sendEvent:] + 4124
50 UIKit 0x0000000112555365 -[UIApplication sendEvent:] + 352
51 UIKit 0x0000000112ea1a1d __dispatchPreprocessedEventFromEventQueue + 2809
52 UIKit 0x0000000112ea4672 __handleEventQueueInternal + 5957
53 CoreFoundation 0x0000000115d4a101 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
54 CoreFoundation 0x0000000115de9f71 __CFRunLoopDoSource0 + 81
55 CoreFoundation 0x0000000115d2ea19 __CFRunLoopDoSources0 + 185
56 CoreFoundation 0x0000000115d2dfff __CFRunLoopRun + 1279
57 CoreFoundation 0x0000000115d2d889 CFRunLoopRunSpecific + 409
58 GraphicsServices 0x0000000118d049c6 GSEventRunModal + 62
59 UIKit 0x00000001125395d6 UIApplicationMain + 159
60 Kab 0x000000010f191137 main + 55
61 libdyld.dylib 0x0000000117112d81 start + 1
62 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
KbNavigationController
class KabNavigationController: SlideNavigationController {
var menuItems: [(id: String, image: String, text: String)] = []
override func viewDidLoad() {
self.leftMenu = self.storyboard?.instantiateViewController(withIdentifier: "MenuViewController")
navigationBar.barTintColor = Theme.DarkGray
navigationBar.tintColor = Theme.White
navigationBar.barStyle = UIBarStyle.black
// Popup Navigation Bar
STPopupNavigationBar.appearance().isHidden = true
}
}
I have searched and debug my code alot keep in mind always enable exception break points to trigger exactly which line causing the crash. You can learn it from this Exception Breakpoint in Xcode . I found my solution here https://github.com/aryaxt/iOS-Slide-Menu/issues/250.
move these two lines from setup function to viewWillLayoutSubviews of Slide Menu.
//moved this from the `setup` function:
self.enableShadow = YES;
self.enableSwipeGesture = YES;
I was trying to add a tool bar at the bottom of UITableView which is> successfully added. But when i connect the bar button with IBAction,
on loading of that view controller app just crashes. Without linking
to IbAction app works fine.
I am using xCode 9.2
Here is my storyboard.
Here is the crash log.
2018-04-11 11:11:38.636121+0500 SafeBolt[9610:88848] *** Assertion failure in -[_UINavigationBarVisualProviderModernIOS _contentViewFittingHeight], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit_Sim/UIKit-3698.33.6/_UINavigationBarVisualProviderModernIOS.m:569
2018-04-11 11:11:38.662356+0500 SafeBolt[9610:88848] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Sigh. Contentview size is zero.'
*** First throw call stack:
(
0 CoreFoundation 0x00000001072b612b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x00000001063fdf41 objc_exception_throw + 48
2 CoreFoundation 0x00000001072bb2f2 +[NSException raise:format:arguments:] + 98
3 Foundation 0x0000000105e9ed69 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 193
4 UIKit 0x00000001085d22f5 -[_UINavigationBarVisualProviderModernIOS _contentViewFittingHeight] + 265
5 UIKit 0x00000001083505e0 -[UINavigationItem _desiredHeightForBarMetrics:defaultHeightBlock:] + 90
6 UIKit 0x00000001085d4fa1 -[_UINavigationBarVisualProviderModernIOS heightRangeFittingWidth:] + 412
7 UIKit 0x0000000107ae40ed -[UINavigationBar _heightRangeForNavigationItem:fittingWidth:] + 210
8 UIKit 0x0000000107bc0a98 -[UINavigationController _intrinsicNavigationBarHeightRangeForViewController:] + 187
9 UIKit 0x0000000107bc09b6 -[UINavigationController _preferredHeightForHidingNavigationBarForViewController:] + 628
10 UIKit 0x0000000107bb088f -[UINavigationController _positionNavigationBarHidden:edge:initialOffset:] + 356
11 UIKit 0x0000000107bb0cf8 -[UINavigationController _positionNavigationBarHidden:edge:] + 388
12 UIKit 0x0000000107bb8555 -[UINavigationController loadView] + 243
13 UIKit 0x0000000107b7b05c -[UIViewController loadViewIfRequired] + 195
14 UIKit 0x0000000107b7b8b9 -[UIViewController view] + 27
15 iOS_Slide_Menu 0x00000001054bbe5a -[SlideNavigationController setEnableShadow:] + 74
16 iOS_Slide_Menu 0x00000001054b9804 -[SlideNavigationController setup] + 244
17 iOS_Slide_Menu 0x00000001054b9541 -[SlideNavigationController initWithCoder:] + 145
18 UIKit 0x0000000107e644c8 -[UIClassSwapper initWithCoder:] + 246
19 UIKit 0x00000001080b9109 UINibDecoderDecodeObjectForValue + 704
20 UIKit 0x00000001080b8e3e -[UINibDecoder decodeObjectForKey:] + 89
21 UIKit 0x0000000107ae075a -[UINavigationBar initWithCoder:] + 753
22 UIKit 0x00000001080b9109 UINibDecoderDecodeObjectForValue + 704
23 UIKit 0x00000001080b8e3e -[UINibDecoder decodeObjectForKey:] + 89
24 UIKit 0x000000010834b5f2 -[UINavigationItem initWithCoder:] + 1018
25 UIKit 0x00000001080b9109 UINibDecoderDecodeObjectForValue + 704
26 UIKit 0x00000001080b8e3e -[UINibDecoder decodeObjectForKey:] + 89
27 UIKit 0x0000000107b76053 -[UIViewController initWithCoder:] + 432
28 SafeBolt 0x000000010448dfa2 _T08SafeBolt18BaseViewControllerCACSgSo7NSCoderC5coder_tcfc + 66
29 SafeBolt 0x000000010446db83 _T08SafeBolt26EmailListingViewControllerCACSgSo7NSCoderC5coder_tcfc + 1315
30 SafeBolt 0x000000010446dc4f _T08SafeBolt26EmailListingViewControllerCACSgSo7NSCoderC5coder_tcfcTo + 47
31 UIKit 0x0000000107e644c8 -[UIClassSwapper initWithCoder:] + 246
32 UIKit 0x00000001080b9109 UINibDecoderDecodeObjectForValue + 704
33 UIKit 0x00000001080b8e3e -[UINibDecoder decodeObjectForKey:] + 89
34 UIKit 0x0000000107e64194 -[UIRuntimeConnection initWithCoder:] + 178
35 UIKit 0x0000000107e648d0 -[UIRuntimeEventConnection initWithCoder:] + 59
36 UIKit 0x00000001080b9109 UINibDecoderDecodeObjectForValue + 704
37 UIKit 0x00000001080b92a7 UINibDecoderDecodeObjectForValue + 1118
38 UIKit 0x00000001080b8e3e -[UINibDecoder decodeObjectForKey:] + 89
39 UIKit 0x0000000107e63391 -[UINib instantiateWithOwner:options:] + 1262
40 UIKit 0x00000001082f3fc2 -[UIStoryboard instantiateViewControllerWithIdentifier:] + 181
41 SafeBolt 0x000000010448eda2 _T08SafeBolt11AppDelegateC23setUpRootViewControlleryyF + 386
42 SafeBolt 0x000000010448f6b5 _T08SafeBolt11AppDelegateC11applicationSbSo13UIApplicationC_s10DictionaryVySC0F16LaunchOptionsKeyVypGSg022didFinishLaunchingWithI0tF + 101
43 SafeBolt 0x000000010448f79a _T08SafeBolt11AppDelegateC11applicationSbSo13UIApplicationC_s10DictionaryVySC0F16LaunchOptionsKeyVypGSg022didFinishLaunchingWithI0tFTo + 186
44 UIKit 0x00000001079cabca -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 299
45 UIKit 0x00000001079cc648 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 4113
46 UIKit 0x00000001079d1aeb -[UIApplication _runWithMainScene:transitionContext:completion:] + 1720
47 UIKit 0x0000000107d9b6f8 __111-[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:]_block_invoke + 924
48 UIKit 0x00000001081714c8 +[_UICanvas _enqueuePostSettingUpdateTransactionBlock:] + 153
49 UIKit 0x0000000107d9b2f1 -[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:] + 249
50 UIKit 0x0000000107d9bb6b -[__UICanvasLifecycleMonitor_Compatability activateEventsOnly:withContext:completion:] + 696
51 UIKit 0x0000000108719a69 __82-[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:]_block_invoke + 262
52 UIKit 0x0000000108719922 -[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:] + 444
53 UIKit 0x00000001083f69c8 __125-[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:]_block_invoke + 221
54 UIKit 0x00000001085f5b06 _performActionsWithDelayForTransitionContext + 100
55 UIKit 0x00000001083f688b -[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:] + 231
56 UIKit 0x0000000108170b25 -[_UICanvas scene:didUpdateWithDiff:transitionContext:completion:] + 392
57 UIKit 0x00000001079d036a -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 523
58 UIKit 0x0000000107fab605 -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 369
59 FrontBoardServices 0x000000010d340cc0 -[FBSSceneImpl _didCreateWithTransitionContext:completion:] + 338
60 FrontBoardServices 0x000000010d3497b5 __56-[FBSWorkspace client:handleCreateScene:withCompletion:]_block_invoke_2 + 235
61 libdispatch.dylib 0x000000010af5933d _dispatch_client_callout + 8
62 libdispatch.dylib 0x000000010af5e9f3 _dispatch_block_invoke_direct + 592
63 FrontBoardServices 0x000000010d375498 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 24
64 FrontBoardServices 0x000000010d37514e -[FBSSerialQueue _performNext] + 464
65 FrontBoardServices 0x000000010d3756bd -[FBSSerialQueue _performNextFromRunLoopSource] + 45
66 CoreFoundation 0x0000000107259101 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
67 CoreFoundation 0x00000001072f8f71 __CFRunLoopDoSource0 + 81
68 CoreFoundation 0x000000010723da19 __CFRunLoopDoSources0 + 185
69 CoreFoundation 0x000000010723cfff __CFRunLoopRun + 1279
70 CoreFoundation 0x000000010723c889 CFRunLoopRunSpecific + 409
71 GraphicsServices 0x000000010dcb79c6 GSEventRunModal + 62
72 UIKit 0x00000001079d35d6 UIApplicationMain + 159
73 SafeBolt 0x0000000104490d27 main + 55
74 libdyld.dylib 0x000000010afd5d81 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
Here is the code for IbAction.
#IBAction func testAction(_ sender: UIBarButtonItem) {
}
Any help would be appreciated.
Please try the following steps in order to solve this issue. Also let me know if it doesn't work for you.
Select the item in storyboard for which you are trying to add IBAction
Check in the connection inspector and see if there are still some extra connections other then the required one.
If there are other extra connections delete them and compile your code again. It should work.
This error usually happens when you create connections and deletes the code from your controller but your connection still exists.
This question already has answers here:
Xcode - How to fix 'NSUnknownKeyException', reason: … this class is not key value coding-compliant for the key X" error?
(79 answers)
Closed 5 years ago.
I'm currently working myself through this tutorial:
https://developer.apple.com/library/content/referencelibrary/GettingStarted/DevelopiOSAppsSwift/ConnectTheUIToCode.html#//apple_ref/doc/uid/TP40015214-CH22-SW1
After creating the function for the button(at ~2/3 on the page) I tried running the code and got the Exception:
2017-12-08 11:24:31.343183+0100 FoodTracker[2159:154603] ***
Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<FoodTracker.ViewController 0x7fea6f406820> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key setDefaultLabelText.'
*** First throw call stack:
(
0 CoreFoundation 0x0000000109d7512b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x00000001060fcf41 objc_exception_throw + 48
2 CoreFoundation 0x0000000109d75079 -[NSException raise] + 9
3 Foundation 0x0000000105b1ba63 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 292
4 UIKit 0x0000000106b39117 -[UIViewController setValue:forKey:] + 87
5 UIKit 0x0000000106e2ac2d -[UIRuntimeOutletConnection connect] + 109
6 CoreFoundation 0x0000000109d183cd -[NSArray makeObjectsPerformSelector:] + 317
7 UIKit 0x0000000106e295e3 -[UINib instantiateWithOwner:options:] + 1856
8 UIKit 0x0000000106b403ff -[UIViewController _loadViewFromNibNamed:bundle:] + 383
9 UIKit 0x0000000106b40d2b -[UIViewController loadView] + 177
10 UIKit 0x0000000106b4105c -[UIViewController loadViewIfRequired] + 195
11 UIKit 0x0000000106b418b9 -[UIViewController view] + 27
12 UIKit 0x0000000106a0c7cf -[UIWindow addRootViewControllerViewIfPossible] + 122
13 UIKit 0x0000000106a0ced7 -[UIWindow _setHidden:forced:] + 294
14 UIKit 0x0000000106a1fe54 -[UIWindow makeKeyAndVisible] + 42
15 UIKit 0x00000001069928b8 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 4737
16 UIKit 0x0000000106997aeb -[UIApplication _runWithMainScene:transitionContext:completion:] + 1720
17 UIKit 0x0000000106d616f8 __111-[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:]_block_invoke + 924
18 UIKit 0x00000001071374c8 +[_UICanvas _enqueuePostSettingUpdateTransactionBlock:] + 153
19 UIKit 0x0000000106d612f1 -[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:] + 249
20 UIKit 0x0000000106d61b6b -[__UICanvasLifecycleMonitor_Compatability activateEventsOnly:withContext:completion:] + 696
21 UIKit 0x00000001076dfa69 __82-[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:]_block_invoke + 262
22 UIKit 0x00000001076df922 -[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:] + 444
23 UIKit 0x00000001073bc9c8 __125-[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:]_block_invoke + 221
24 UIKit 0x00000001075bbb06 _performActionsWithDelayForTransitionContext + 100
25 UIKit 0x00000001073bc88b -[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:] + 231
26 UIKit 0x0000000107136b25 -[_UICanvas scene:didUpdateWithDiff:transitionContext:completion:] + 392
27 UIKit 0x000000010699636a -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 523
28 UIKit 0x0000000106f71605 -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 369
29 FrontBoardServices 0x000000010bc38cc0 -[FBSSceneImpl _didCreateWithTransitionContext:completion:] + 338
30 FrontBoardServices 0x000000010bc417b5 __56-[FBSWorkspace client:handleCreateScene:withCompletion:]_block_invoke_2 + 235
31 libdispatch.dylib 0x000000010ae9733d _dispatch_client_callout + 8
32 libdispatch.dylib 0x000000010ae9c9f3 _dispatch_block_invoke_direct + 592
33 FrontBoardServices 0x000000010bc6d498 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 24
34 FrontBoardServices 0x000000010bc6d14e -[FBSSerialQueue _performNext] + 464
35 FrontBoardServices 0x000000010bc6d6bd -[FBSSerialQueue _performNextFromRunLoopSource] + 45
36 CoreFoundation 0x0000000109d18101 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
37 CoreFoundation 0x0000000109db7f71 __CFRunLoopDoSource0 + 81
38 CoreFoundation 0x0000000109cfca19 __CFRunLoopDoSources0 + 185
39 CoreFoundation 0x0000000109cfbfff __CFRunLoopRun + 1279
40 CoreFoundation 0x0000000109cfb889 CFRunLoopRunSpecific + 409
41 GraphicsServices 0x000000010c5019c6 GSEventRunModal + 62
42 UIKit 0x00000001069995d6 UIApplicationMain + 159
43 FoodTracker 0x00000001057e7b67 main + 55
44 libdyld.dylib 0x000000010af13d81 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
Here is my Code:
And the connections inspector of the button:
This is due to FoodTracker VC in storyboard has an outlet created but not connected.
How to resolve the issue? Follow these steps.
Open your storyboard, click on view controller below view controller scene.
Check for all outlets for ViewController.
Remove those outlets created and are not connected to ViewController.swift implementation file.
Keep me updated on the same.
Check your connection to #IBAction with this steps below:
In the storyboard:
In your view controller:
Updated:
In your case, you should remove connection in Reference Outlets because you connect it to the label outlet.
I have this app in the app store, which according to Crashalitics, its %92-%95 stable. I made a similar app for Android and its around 98% stable. I am trying to get the stability up - but I don't see how. All the bugs I am seeing in the IOS version are not touching my code.
I see random bugs, that are not reproducible, and when they do are very random. Each happens 1-10 times, but I have a list of ... ~30 different items.
The app is pretty simple - a mostly linear storyboard (a few jumps, but no loops). The only project I am using which is not Apple's code is InAppSettingsKit, and most of the app is just maps which shows some items. The project is using ARC and currently compiled using XCode6 (but XCode5 showed the same symptoms).
How can I find these crashes? Is this in an inherent problem of IOS7-8? I do see some apps just closing up when I use the IPhone, and friends to tell me that IOS is not that stable, but ... I just think I am doing something wrong.
IOS8 70% IOS7 30%
Thread : Crashed: com.apple.main-thread
0 libobjc.A.dylib 0x36444f66 objc_msgSend + 5
1 UIKit 0x2c160b35 -[UIScrollView(UIScrollViewInternal) _delegateScrollViewAnimationEnded] + 52
2 UIKit 0x2c160ac1 -[UIScrollView(UIScrollViewInternal) _scrollViewAnimationEnded:finished:] + 184
3 UIKit 0x2c20a5e5 -[UIAnimator stopAnimation:] + 476
4 UIKit 0x2c209fb9 -[UIAnimator(Static) _advanceAnimationsOfType:withTimestamp:] + 304
5 UIKit 0x2c209e85 -[UIAnimator(Static) _LCDHeartbeatCallback:] + 52
6 QuartzCore 0x2bae4aeb CA::Display::DisplayLinkItem::dispatch() + 98
7 QuartzCore 0x2bae4953 CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 366
8 IOMobileFramebuffer 0x303c482f IOMobileFramebufferVsyncNotifyFunc + 90
9 IOKit 0x29af01ed IODispatchCalloutFromCFMessage + 256
10 CoreFoundation 0x28b7c3a5 __CFMachPortPerform + 132
11 CoreFoundation 0x28b8c7f3 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 34
12 CoreFoundation 0x28b8c78f __CFRunLoopDoSource1 + 346
13 CoreFoundation 0x28b8adb1 __CFRunLoopRun + 1608
14 CoreFoundation 0x28ad7b31 CFRunLoopRunSpecific + 476
15 CoreFoundation 0x28ad7943 CFRunLoopRunInMode + 106
16 GraphicsServices 0x2feb7051 GSEventRunModal + 136
17 UIKit 0x2c0cd6f1 UIApplicationMain + 1440
18 --------------- 0x000c8833 main (main.m:16)
IOS7 - 8 times
Thread : Fatal Exception: NSInvalidArgumentException
0 CoreFoundation 0x2e23ef83 __exceptionPreprocess + 130
1 libobjc.A.dylib 0x389efccf objc_exception_throw + 38
2 CoreFoundation 0x2e242917 -[NSObject(NSObject) doesNotRecognizeSelector:] + 202
3 CoreFoundation 0x2e241203 ___forwarding___ + 706
4 CoreFoundation 0x2e190768 _CF_forwarding_prep_0 + 24
5 VectorKit 0x35ec6911 -[VKMapCanvas initShouldRasterize:contentScale:inBackground:] + 476
6 VectorKit 0x35ec620f -[VKMapView initWithGlobe:shouldRasterize:inBackground:] + 230
7 MapKit 0x2f3d980b -[MKBasicMapView initWithFrame:andGlobe:shouldRasterize:] + 322
8 MapKit 0x2f40cd77 -[MKMapView _commonInitAndEnableLoading:fromIB:gestureRecognizerHostView:showsAttribution:] + 878
9 MapKit 0x2f40d86b -[MKMapView initWithCoder:] + 134
10 UIKit 0x30e70169 UINibDecoderDecodeObjectForValue + 740
11 UIKit 0x30e6fe7f -[UINibDecoder decodeObjectForKey:] + 90
12 UIKit 0x30dcb5ff -[UIRuntimeConnection initWithCoder:] + 150
13 UIKit 0x30e70169 UINibDecoderDecodeObjectForValue + 740
14 UIKit 0x30e70109 UINibDecoderDecodeObjectForValue + 644
15 UIKit 0x30e6fe7f -[UINibDecoder decodeObjectForKey:] + 90
16 UIKit 0x30dcadd1 -[UINib instantiateWithOwner:options:] + 888
17 UIKit 0x30d2360b -[UIViewController _loadViewFromNibNamed:bundle:] + 234
18 UIKit 0x30b7fbcd -[UIViewController loadView] + 92
19 UIKit 0x30a602ed -[UIViewController loadViewIfRequired] + 72
20 UIKit 0x30a60269 -[UIViewController view] + 24
21 UIKit 0x30b0a14b -[UINavigationController _startTransition:fromViewController:toViewController:] + 198
22 UIKit 0x30b09dfd -[UINavigationController _startDeferredTransitionIfNeeded:] + 572
23 UIKit 0x30b09b6d -[UINavigationController __viewWillLayoutSubviews] + 44
24 UIKit 0x30b09b05 -[UILayoutContainerView layoutSubviews] + 184
25 UIKit 0x30a5bd59 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 380
26 QuartzCore 0x306d962b -[CALayer layoutSublayers] + 142
27 QuartzCore 0x306d4e3b CA::Layer::layout_if_needed(CA::Transaction*) + 350
28 QuartzCore 0x30703cdd -[CALayer layoutIfNeeded] + 140
29 UIKit 0x30ad8163 -[UIViewController window:setupWithInterfaceOrientation:] + 242
30 UIKit 0x30ad6783 -[UIWindow _setRotatableClient:toOrientation:updateStatusBar:duration:force:isRotating:] + 3498
31 UIKit 0x30ad59d3 -[UIWindow _setRotatableClient:toOrientation:updateStatusBar:duration:force:] + 46
32 UIKit 0x30ad595b -[UIWindow _setRotatableViewOrientation:updateStatusBar:duration:force:] + 94
33 UIKit 0x30ad58f3 -[UIWindow _setRotatableViewOrientation:duration:force:] + 42
34 UIKit 0x30acdf69 __57-[UIWindow _updateToInterfaceOrientation:duration:force:]_block_invoke + 108
35 UIKit 0x30a62107 -[UIWindow _updateToInterfaceOrientation:duration:force:] + 382
36 UIKit 0x30ad5641 -[UIWindow setAutorotates:forceUpdateInterfaceOrientation:] + 696
37 UIKit 0x30ad5105 -[UIViewController _tryBecomeRootViewControllerInWindow:] + 164
38 UIKit 0x30a67045 -[UIWindow addRootViewControllerViewIfPossible] + 460
39 UIKit 0x30a64827 -[UIWindow _setHidden:forced:] + 302
40 UIKit 0x30ace33d -[UIWindow makeKeyAndVisible] + 60
41 UIKit 0x30acafad -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1820
42 UIKit 0x30ac556b -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 714
43 UIKit 0x30a616e9 -[UIApplication handleEvent:withNewEvent:] + 3540
44 UIKit 0x30a60851 -[UIApplication sendEvent:] + 72
45 UIKit 0x30ac4ca9 _UIApplicationHandleEvent + 616
46 GraphicsServices 0x33079aed _PurpleEventCallback + 608
47 GraphicsServices 0x330796d7 PurpleEventCallback + 34
48 CoreFoundation 0x2e209a67 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 34
49 CoreFoundation 0x2e209a03 __CFRunLoopDoSource1 + 346
50 CoreFoundation 0x2e2081d7 __CFRunLoopRun + 1398
51 CoreFoundation 0x2e172ebf CFRunLoopRunSpecific + 522
52 CoreFoundation 0x2e172ca3 CFRunLoopRunInMode + 106
53 UIKit 0x30ac3ed1 -[UIApplication _run] + 760
54 UIKit 0x30abf14d UIApplicationMain + 1136
55 --------------- 0x000ef833 main (main.m:16)
56 libdyld.dylib 0x38efcab7 start + 2
Another (IOS 6.1.6)
vThread : Fatal Exception: NSGenericException
0 CoreFoundation 0x31eaf2a3 __exceptionPreprocess + 162
1 libobjc.A.dylib 0x39b0b97f objc_exception_throw + 30
2 UIKit 0x3404d30f -[UIStoryboardPushSegue perform] + 1118
3 UIKit 0x33da20c5 -[UIApplication sendAction:to:from:forEvent:] + 72
4 UIKit 0x33da214d -[UIBarButtonItem(UIInternal) _sendAction:withEvent:] + 120
5 UIKit 0x33da20c5 -[UIApplication sendAction:to:from:forEvent:] + 72
6 UIKit 0x33da2077 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 30
7 UIKit 0x33da2055 -[UIControl sendAction:to:forEvent:] + 44
8 UIKit 0x33da190b -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 502
9 UIKit 0x33da1e01 -[UIControl touchesEnded:withEvent:] + 488
10 UIKit 0x33cca5f1 -[UIWindow _sendTouchesForEvent:] + 524
11 UIKit 0x33cb7801 -[UIApplication sendEvent:] + 380
12 UIKit 0x33cb711b _UIApplicationHandleEvent + 6154
13 GraphicsServices 0x359735a3 _PurpleEventCallback + 590
14 GraphicsServices 0x359731d3 PurpleEventCallback + 34
15 CoreFoundation 0x31e84173 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 34
16 CoreFoundation 0x31e84117 __CFRunLoopDoSource1 + 138
17 CoreFoundation 0x31e82f99 __CFRunLoopRun + 1384
18 CoreFoundation 0x31df5ebd CFRunLoopRunSpecific + 356
19 CoreFoundation 0x31df5d49 CFRunLoopRunInMode + 104
20 GraphicsServices 0x359722eb GSEventRunModal + 74
21 UIKit 0x33d0b301 UIApplicationMain + 1120
22 --------------- 0x00116833 main (main.m:16)
23 libdyld.dylib 0x39f42b20 start
In my iOS app there is a view with a tableview inside. The table cells are loaded from a PHP file on a remote server. I have also put a NSTimer on the view controller that should reload the data.
The cells contain information that may change on a time interval. That is working fine only if the number of cells doesn't change on a time interval. If a cell is added on a time interval, then the app crashes.
This is the code for the NSTimer:
self.timer = [NSTimer scheduledTimerWithTimeInterval:10 target:self selector:#selector(refrescar) userInfo:nil repeats:YES];
And this is the code for the method refrescar:
- (void)refrescar {
total_actual =0;
total =0;
[self viewDidLoad];
}
I have also tried with this one:
- (void)refrescar {
total_actual =0;
total =0;
[self.tableView reloadData];
}
But the app crashes as with the other code with [self viewDidLoad];
Any help is welcome.
Error log:
2014-11-13 23:52:23.299 RestAppXXI[1552:607] -[NSNull length]: unrecognized selector sent to instance 0xcb6068
2014-11-13 23:52:23.429 RestAppXXI[1552:607] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSNull length]: unrecognized selector sent to instance 0xcb6068'
*** First throw call stack:
(
0 CoreFoundation 0x00b6a1e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x031588e5 objc_exception_throw + 44
2 CoreFoundation 0x00c07243 -[NSObject(NSObject) doesNotRecognizeSelector:] + 275
3 CoreFoundation 0x00b5a50b ___forwarding___ + 1019
4 CoreFoundation 0x00b5a0ee _CF_forwarding_prep_0 + 14
5 UIKit 0x01fd2cc7 -[UILabel _textRectForBounds:limitedToNumberOfLines:includingShadow:] + 57
6 UIKit 0x01fd2b13 -[UILabel textRectForBounds:limitedToNumberOfLines:] + 85
7 UIKit 0x01fd662e -[UILabel _intrinsicSizeWithinSize:] + 173
8 UIKit 0x01fd6751 -[UILabel intrinsicContentSize] + 91
9 UIKit 0x024b07ef -[UIView(UIConstraintBasedLayout) _generateContentSizeConstraints] + 36
10 UIKit 0x024b0480 -[UIView(UIConstraintBasedLayout) _updateContentSizeConstraints] + 511
11 UIKit 0x024b67bf -[UIView(AdditionalLayoutSupport) updateConstraints] + 110
12 UIKit 0x01fd6579 -[UILabel updateConstraints] + 189
13 UIKit 0x024b6058 -[UIView(AdditionalLayoutSupport) _internalUpdateConstraintsIfNeededAccumulatingViewsNeedingSecondPass:] + 239
14 UIKit 0x024b61d6 -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededAccumulatingViewsNeedingSecondPass:] + 122
15 UIKit 0x024b6157 __UIViewRecursionHelper + 40
16 CoreFoundation 0x00b0bc69 CFArrayApplyFunction + 57
17 UIKit 0x024b5ffc -[UIView(AdditionalLayoutSupport) _internalUpdateConstraintsIfNeededAccumulatingViewsNeedingSecondPass:] + 147
18 UIKit 0x024b61d6 -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededAccumulatingViewsNeedingSecondPass:] + 122
19 UIKit 0x024b6157 __UIViewRecursionHelper + 40
20 CoreFoundation 0x00b0bc69 CFArrayApplyFunction + 57
21 UIKit 0x024b5ffc -[UIView(AdditionalLayoutSupport) _internalUpdateConstraintsIfNeededAccumulatingViewsNeedingSecondPass:] + 147
22 UIKit 0x024b61d6 -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededAccumulatingViewsNeedingSecondPass:] + 122
23 UIKit 0x024b6157 __UIViewRecursionHelper + 40
24 CoreFoundation 0x00b0bc69 CFArrayApplyFunction + 57
25 UIKit 0x024b5ffc -[UIView(AdditionalLayoutSupport) _internalUpdateConstraintsIfNeededAccumulatingViewsNeedingSecondPass:] + 147
26 UIKit 0x024b61d6 -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededAccumulatingViewsNeedingSecondPass:] + 122
27 UIKit 0x024b6157 __UIViewRecursionHelper + 40
28 CoreFoundation 0x00b0bc69 CFArrayApplyFunction + 57
29 UIKit 0x024b5ffc -[UIView(AdditionalLayoutSupport) _internalUpdateConstraintsIfNeededAccumulatingViewsNeedingSecondPass:] + 147
30 UIKit 0x024b61d6 -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededAccumulatingViewsNeedingSecondPass:] + 122
31 UIKit 0x024b6157 __UIViewRecursionHelper + 40
32 CoreFoundation 0x00b0bc69 CFArrayApplyFunction + 57
33 UIKit 0x024b5ffc -[UIView(AdditionalLayoutSupport) _internalUpdateConstraintsIfNeededAccumulatingViewsNeedingSecondPass:] + 147
34 UIKit 0x024b61d6 -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededAccumulatingViewsNeedingSecondPass:] + 122
35 UIKit 0x024b6157 __UIViewRecursionHelper + 40
36 CoreFoundation 0x00b0bc69 CFArrayApplyFunction + 57
37 UIKit 0x024b5ffc -[UIView(AdditionalLayoutSupport) _internalUpdateConstraintsIfNeededAccumulatingViewsNeedingSecondPass:] + 147
38 UIKit 0x024b61d6 -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededAccumulatingViewsNeedingSecondPass:] + 122
39 UIKit 0x024b6157 __UIViewRecursionHelper + 40
40 CoreFoundation 0x00b0bc69 CFArrayApplyFunction + 57
41 UIKit 0x024b5ffc -[UIView(AdditionalLayoutSupport) _internalUpdateConstraintsIfNeededAccumulatingViewsNeedingSecondPass:] + 147
42 UIKit 0x024b61d6 -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededAccumulatingViewsNeedingSecondPass:] + 122
43 UIKit 0x024b6157 __UIViewRecursionHelper + 40
44 CoreFoundation 0x00b0bc69 CFArrayApplyFunction + 57
45 UIKit 0x024b5ffc -[UIView(AdditionalLayoutSupport) _internalUpdateConstraintsIfNeededAccumulatingViewsNeedingSecondPass:] + 147
46 UIKit 0x024b61d6 -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededAccumulatingViewsNeedingSecondPass:] + 122
47 UIKit 0x024b6157 __UIViewRecursionHelper + 40
48 CoreFoundation 0x00b0bc69 CFArrayApplyFunction + 57
49 UIKit 0x024b5ffc -[UIView(AdditionalLayoutSupport) _internalUpdateConstraintsIfNeededAccumulatingViewsNeedingSecondPass:] + 147
50 UIKit 0x024b61d6 -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededAccumulatingViewsNeedingSecondPass:] + 122
51 UIKit 0x024b6157 __UIViewRecursionHelper + 40
52 CoreFoundation 0x00b0bc69 CFArrayApplyFunction + 57
53 UIKit 0x024b5ffc -[UIView(AdditionalLayoutSupport) _internalUpdateConstraintsIfNeededAccumulatingViewsNeedingSecondPass:] + 147
54 UIKit 0x024b61d6 -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededAccumulatingViewsNeedingSecondPass:] + 122
55 UIKit 0x024aa878 __62-[UIWindow(UIConstraintBasedLayout) updateConstraintsIfNeeded]_block_invoke + 43
56 Foundation 0x02f0b68c -[NSISEngine withBehaviors:performModifications:] + 107
57 Foundation 0x02d9b3c5 -[NSISEngine withAutomaticOptimizationDisabled:] + 48
58 UIKit 0x024aa590 -[UIWindow(UIConstraintBasedLayout) updateConstraintsIfNeeded] + 225
59 UIKit 0x024aa467 -[UIWindow(UIConstraintBasedLayout) layoutSublayersOfLayer:] + 90
60 libobjc.A.dylib 0x0316a82b -[NSObject performSelector:withObject:] + 70
61 QuartzCore 0x0171a45a -[CALayer layoutSublayers] + 148
62 QuartzCore 0x0170e244 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 380
63 QuartzCore 0x0170e0b0 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 26
64 QuartzCore 0x016747fa _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 294
65 QuartzCore 0x01675b85 _ZN2CA11Transaction6commitEv + 393
66 QuartzCore 0x01676258 _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 92
67 CoreFoundation 0x00b3236e __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 30
68 CoreFoundation 0x00b322bf __CFRunLoopDoObservers + 399
69 CoreFoundation 0x00b10254 __CFRunLoopRun + 1076
70 CoreFoundation 0x00b0f9d3 CFRunLoopRunSpecific + 467
71 CoreFoundation 0x00b0f7eb CFRunLoopRunInMode + 123
72 GraphicsServices 0x041945ee GSEventRunModal + 192
73 GraphicsServices 0x0419442b GSEventRun + 104
74 UIKit 0x01e18f9b UIApplicationMain + 1225
75 RestAppXXI 0x000305ed main + 141
76 libdyld.dylib 0x049eb6d9 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
That is not relevant to your UITableView. That is most probably from a string you are trying to access, but it's nil.
User exception break point to debug, you are calling length method on NSNull object
And why to use NSTimer, you can reload table after getting response from server