I am an Android Developer and trying some dummy for the iOS development.
I am trying a tutorial for AMSlideMenu and it was working well at a certain point of development.
I followed the complete tutorial and it worked well. After sometime while I was experimenting some other functionality the code breaked.
I undo and reverted back the changes but something still looks wrong.
below is the crash log, but i cant understand what went wrong
*** First throw call stack:
(
0 CoreFoundation 0x000000010bdf93f5 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010b6e9bb7 objc_exception_throw + 45
2 UIKit 0x000000010c7bd43b -[UIViewController shouldPerformSegueWithIdentifier:sender:] + 0
3 Pranshu1 0x000000010b1a0d4f -[AMSlideMenuMainViewController setup] + 1071
4 Pranshu1 0x000000010b19dc63 -[AMSlideMenuMainViewController viewDidLoad] + 419
5 Pranshu1 0x000000010b19d1b6 -[MainViewController viewDidLoad] + 54
6 UIKit 0x000000010c7bb190 -[UIViewController loadViewIfRequired] + 738
7 UIKit 0x000000010c7e95db -[UINavigationController _layoutViewController:] + 44
8 UIKit 0x000000010c7e9b25 -[UINavigationController _updateScrollViewFromViewController:toViewController:] + 216
9 UIKit 0x000000010c7e9c24 -[UINavigationController _startTransition:fromViewController:toViewController:] + 92
10 UIKit 0x000000010c7ea9f7 -[UINavigationController _startDeferredTransitionIfNeeded:] + 523
11 UIKit 0x000000010c7eb4b7 -[UINavigationController __viewWillLayoutSubviews] + 43
12 UIKit 0x000000010c92f399 -[UILayoutContainerView layoutSubviews] + 202
13 UIKit 0x000000010c70f199 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 521
14 QuartzCore 0x000000010c521f98 -[CALayer layoutSublayers] + 150
15 QuartzCore 0x000000010c516bbe _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 380
16 QuartzCore 0x000000010c516a2e _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 24
17 QuartzCore 0x000000010c484ade _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 242
18 QuartzCore 0x000000010c485bea _ZN2CA11Transaction6commitEv + 390
19 UIKit 0x000000010c69467d -[UIApplication _reportMainSceneUpdateFinished:] + 44
20 UIKit 0x000000010c695368 -[UIApplication _runWithMainScene:transitionContext:completion:] + 2642
21 UIKit 0x000000010c693d22 -[UIApplication workspaceDidEndTransaction:] + 179
22 FrontBoardServices 0x00000001114912a3 __31-[FBSSerialQueue performAsync:]_block_invoke + 16
23 CoreFoundation 0x000000010bd2eabc __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12
24 CoreFoundation 0x000000010bd24805 __CFRunLoopDoBlocks + 341
25 CoreFoundation 0x000000010bd245c5 __CFRunLoopRun + 2389
26 CoreFoundation 0x000000010bd23a06 CFRunLoopRunSpecific + 470
27 UIKit 0x000000010c693799 -[UIApplication _run] + 413
28 UIKit 0x000000010c696550 UIApplicationMain + 1282
29 Pranshu1 0x000000010b1ad003 main + 115
30 libdyld.dylib 0x000000010e822145 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Thanks in Advance
Looking up from the top (0) entry the last of your methods is: Pranshu1 so you need to look there.
The last method is: -[UIViewController shouldPerformSegueWithIdentifier:sender:]
so it looks like you are performing a Segue, check the identifier.
Before that is the method AMSlideMenuMainViewController so it looks like you are probably using the 3rd party code AMSlideMenu, check for correct usage.
Here is how to catch the exceptions at the point of the error:
To see the actual statement that is causing the error add an exception breakpoint:
From the Main Menu Debug:Breakpoints:Create Exception Breakpoint.
Right-click the breakpoint and set the exception to Objective-C.
Add an action: "po $arg1".
Run the app to get the breakpoint and you will be at the line that causes the exception and the error message will be in the debugger console.
Creating the breakpoint example:
Related
The UITableView works fine when I am trying to use it through Xcode6.4, but when I'm trying it through Xcode 7.1.1 it crashes. I guess it's because of the iOS versions. I am attaching the crash log. Kindly suggest what the best way to fix it is. I am quite sure that:
1) Datasource and Delegates are working fine.
2) Numberofrows and heightOfRow methods are also getting called, but it crashes before the cellForRowAtIndexPath gets called.
Here is the log:
2016-02-05 15:34:27.400 Autograph24[3720:87023] * Assertion failure
in -[UITableViewRowData _assertValidIndexPath:allowEmptySection:],
/BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit_Sim/UIKit-3512.29.5/UITableViewRowData.m:2310
2016-02-05 15:34:27.506 Autograph24[3720:87023] * Terminating app
due to uncaught exception 'NSInternalInconsistencyException', reason:
'Invalid indexPath'
*** First throw call stack: ( 0 CoreFoundation 0x00000001075c9f45 exceptionPreprocess + 165 1 libobjc.A.dylib
0x0000000107956deb objc_exception_throw + 48 2 CoreFoundation
0x00000001075c9daa +[NSException raise:format:arguments:] + 106 3
Foundation 0x0000000106e9b5ee
-[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 198 4
UIKit 0x0000000108d11412
-[UITableViewRowData _assertValidIndexPath:allowEmptySection:] + 963 5 UIKit 0x0000000108d11465
-[UITableViewRowData ensureHeightsFaultedInForIndexPath:availHeight:edgeInset:scrollPosition:]
+ 55 6 UIKit 0x0000000108af50c6 -[UITableView _contentOffsetForScrollingToRowAtIndexPath:atScrollPosition:] + 2510 7 UIKit 0x0000000108af59b9
-[UITableView scrollToRowAtIndexPath:atScrollPosition:animated:] + 39 8 Autograph24 0x0000000106b1b2ad
-[DashboardVC scrollToToday] + 685 9 Autograph24 0x0000000106b20289 -[DashboardVC changeCalendarStyle] + 313 10
Autograph24 0x0000000106b20144 -[DashboardVC
resizeScreenForPortrait] + 788 11 Autograph24
0x0000000106b1f6a0 -[DashboardVC rotateScreen] + 176 12 Autograph24
0x0000000106b15e76 -[DashboardVC viewDidLoad] + 166 13 UIKit
0x0000000108b49cc4 -[UIViewController loadViewIfRequired] + 1198 14
UIKit 0x0000000108b4fc7b
-[UIViewController __viewWillAppear:] + 120 15 UIKit 0x0000000108b7fa37 -[UINavigationController _startCustomTransition:] +
1203 16 UIKit 0x0000000108b8fcdb
-[UINavigationController _startDeferredTransitionIfNeeded:] + 712 17 UIKit 0x0000000108b90cea
-[UINavigationController __viewWillLayoutSubviews] + 57 18 UIKit 0x0000000108d36c85 -[UILayoutContainerView layoutSubviews] + 248 19
UIKit 0x0000000108a6be40
-[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 710 20 QuartzCore 0x000000010736359a -[CALayer
layoutSublayers] + 146 21 QuartzCore
0x0000000107357e70 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE +
366 22 QuartzCore 0x0000000107357cee
_ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 24 23 QuartzCore 0x000000010734c475
_ZN2CA7Context18commit_transactionEPNS_11TransactionE + 277 24 QuartzCore 0x0000000107379c0a
_ZN2CA11Transaction6commitEv + 486 25 QuartzCore 0x000000010737a37c
_ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 92 26 CoreFoundation 0x00000001074f5947
__CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION + 23 27 CoreFoundation 0x00000001074f58b7
__CFRunLoopDoObservers + 391 28 CoreFoundation 0x00000001074eb50b __CFRunLoopRun + 1147 29 CoreFoundation
0x00000001074eae08 CFRunLoopRunSpecific + 488 30 GraphicsServices
0x000000010b1b5ad2 GSEventRunModal + 161 31 UIKit
0x00000001089b730d UIApplicationMain + 171 32 Autograph24
0x0000000106b15d9f main + 111 33 libdyld.dylib
0x000000010aac192d start + 1 34 ???
0x0000000000000001 0x0 + 1 ) libc++abi.dylib: terminating with
uncaught exception of type NSException
You have an invalid indexpath. That means that either the section or the row or both is not right. If you have a table with 2 sections and 2 rows per section then indexpath 0-3 is invalid, because section 0 does not provide a row 3. Similarly, indexpath 2-1 would be invalid, because section 2 does not exist (only 0 and 1).
As for how to fix this, first double check if all required methods are called and your data is correctly initialised. Then sprinkle breakpoints around your class. Mainly where you use any kind of indexpath, and see where it tries to read from outside your data.
Learn to read crash logs. In most cases and certainly in this case, they contain all the relevant information:
2016-02-05 15:34:27.400 Autograph24[3720:87023] * Assertion failure in -[UITableViewRowData _assertValidIndexPath:allowEmptySection:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit_Sim/UIKit-3512.29.5/UITableViewRowData.m:2310
2016-02-05 15:34:27.506 Autograph24[3720:87023] * Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid indexPath'
It clearly says: reason: 'Invalid indexPath'
So first hint: an invalid index path (which is a well known thing if you work with UITableViews) was involved.
Next follows the stack trace where the error ocurred. The first few stack locations are within Apple's code. Usually skip them. But occasionally, they contain interesting hints. Here a function assertValidIndexPath:allowEmptySection:. That again shows that the index path is the problem.
*** First throw call stack: (
0 CoreFoundation 0x00000001075c9f45 exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000107956deb objc_exception_throw + 48
2 CoreFoundation 0x00000001075c9daa +[NSException raise:format:arguments:] + 106
3 Foundation 0x0000000106e9b5ee -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 198
4 UIKit 0x0000000108d11412 -[UITableViewRowData _assertValidIndexPath:allowEmptySection:] + 963
5 UIKit 0x0000000108d11465 -[UITableViewRowData ensureHeightsFaultedInForIndexPath:availHeight:edgeInset:scrollPosition:] + 55
6 UIKit 0x0000000108af50c6 -[UITableView _contentOffsetForScrollingToRowAtIndexPath:atScrollPosition:] + 2510
7 UIKit 0x0000000108af59b9 -[UITableView scrollToRowAtIndexPath:atScrollPosition:animated:] + 39
Here your code follows. Look at the line above and below. It says that your function [DashboardVC scrollToToday] has called the function [UITableView scrollToRowAtIndexPath:atScrollPosition:animated:]. This is where the error was triggered in your code.
8 Autograph24 0x0000000106b1b2ad -[DashboardVC scrollToToday] + 685
9 Autograph24 0x0000000106b20289 -[DashboardVC changeCalendarStyle] + 313
10 Autograph24 0x0000000106b20144 -[DashboardVC resizeScreenForPortrait] + 788
11 Autograph24 0x0000000106b1f6a0 -[DashboardVC rotateScreen] + 176
12 Autograph24 0x0000000106b15e76 -[DashboardVC viewDidLoad] + 166
This is the next interesting location. Here Apple's UIKit called your [DashboardVC viewDidLoad]. So that gives a lot of context. It happend early during the construction of you view in the viewDidLoad phase.
13 UIKit 0x0000000108b49cc4 -[UIViewController loadViewIfRequired] + 1198
14 UIKit 0x0000000108b4fc7b -[UIViewController __viewWillAppear:] + 120
15 UIKit 0x0000000108b7fa37 -[UINavigationController _startCustomTransition:] + 1203
16 UIKit 0x0000000108b8fcdb -[UINavigationController _startDeferredTransitionIfNeeded:] + 712
17 UIKit 0x0000000108b90cea -[UINavigationController __viewWillLayoutSubviews] + 57
18 UIKit 0x0000000108d36c85 -[UILayoutContainerView layoutSubviews] + 248
19 UIKit 0x0000000108a6be40 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 710
20 QuartzCore 0x000000010736359a -[CALayer layoutSublayers] + 146
21 QuartzCore 0x0000000107357e70 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 366
22 QuartzCore 0x0000000107357cee _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 24
23 QuartzCore 0x000000010734c475 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 277
24 QuartzCore 0x0000000107379c0a _ZN2CA11Transaction6commitEv + 486
25 QuartzCore 0x000000010737a37c _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 92
26 CoreFoundation 0x00000001074f5947 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION + 23
27 CoreFoundation 0x00000001074f58b7 __CFRunLoopDoObservers + 391
28 CoreFoundation 0x00000001074eb50b __CFRunLoopRun + 1147
29 CoreFoundation 0x00000001074eae08 CFRunLoopRunSpecific + 488
30 GraphicsServices 0x000000010b1b5ad2 GSEventRunModal + 161
31 UIKit 0x00000001089b730d UIApplicationMain + 171
32 Autograph24 0x0000000106b15d9f main + 111
33 libdyld.dylib 0x000000010aac192d start + 1
34 ??? 0x0000000000000001 0x0 + 1 ) libc++abi.dylib:
terminating with uncaught exception of type NSException
Combining this information I would conclude that you call [UITableView scrollToRowAtIndexPath:atScrollPosition:animated:] from within [DashboardVC viewDidLoad], which is bound to fail with any index path because the UITableView is not properly constructed at this time of the view controller's lifecycle.
Earlier iOS versions were more lenient here; but later versions are rather restrictive about what you can do before the view controller is fully constructed.
You will need to move your [UITableView scrollToRowAtIndexPath:atScrollPosition:animated:] call to either viewWillAppear: or even viewDidAppear:.
Maybe somebody can help, I'm trying to move my app to facilitate a new target for the Apple TV.
I create the new Storyboard and linked everything the same way as it has been in the iOS application. When I'm trying to start the application I get the following exception, after the AppDelegate is executed (before it goes into the viewDidLoad of the initial controller.
Any ideas?
2015-09-19 12:24:44.629 App TV[46733:3797033] *** Terminating app due to uncaught exception 'CALayerInvalid', reason: 'layer <CATransformLayer: 0x7fc1e0d51fc0> is a part of cycle in its layer tree'
*** First throw call stack:
(
0 CoreFoundation 0x000000010e850105 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010f271deb objc_exception_throw + 48
2 CoreFoundation 0x000000010e85003d +[NSException raise:format:] + 205
3 QuartzCore 0x0000000111d2f74a _ZN2CA5Layer30ensure_transaction_recursivelyEPNS_11TransactionE + 102
4 QuartzCore 0x0000000111d2f795 _ZN2CA5Layer30ensure_transaction_recursivelyEPNS_11TransactionE + 177
5 QuartzCore 0x0000000111d2f795 _ZN2CA5Layer30ensure_transaction_recursivelyEPNS_11TransactionE + 177
6 QuartzCore 0x0000000111d2f795 _ZN2CA5Layer30ensure_transaction_recursivelyEPNS_11TransactionE + 177
7 QuartzCore 0x0000000111d37439 _ZN2CA5Layer15insert_sublayerEPNS_11TransactionEP7CALayerm + 389
8 QuartzCore 0x0000000111d3782a -[CALayer addSublayer:] + 193
9 UIKit 0x000000010d2ce424 -[UIView(Internal) _addSubview:positioned:relativeTo:] + 1512
10 UIKit 0x000000010d5b1b56 -[UIButton initWithCoder:] + 1424
11 UIKit 0x000000010d79dd62 UINibDecoderDecodeObjectForValue + 705
12 UIKit 0x000000010d79da98 -[UINibDecoder decodeObjectForKey:] + 278
13 UIKit 0x000000010d5d1315 -[UIRuntimeConnection initWithCoder:] + 134
14 UIKit 0x000000010d5d1a77 -[UIRuntimeEventConnection initWithCoder:] + 60
15 UIKit 0x000000010d79dd62 UINibDecoderDecodeObjectForValue + 705
16 UIKit 0x000000010d79df23 UINibDecoderDecodeObjectForValue + 1154
17 UIKit 0x000000010d79da98 -[UINibDecoder decodeObjectForKey:] + 278
18 UIKit 0x000000010d5d0555 -[UINib instantiateWithOwner:options:] + 1255
19 UIKit 0x000000010d3ad7f2 -[UIViewController _loadViewFromNibNamed:bundle:] + 381
20 UIKit 0x000000010d3ae11e -[UIViewController loadView] + 178
21 UIKit 0x000000010d3ae47d -[UIViewController loadViewIfRequired] + 139
22 UIKit 0x000000010d3aec7e -[UIViewController view] + 27
23 UIKit 0x000000010d289484 -[UIWindow addRootViewControllerViewIfPossible] + 61
24 UIKit 0x000000010d289b81 -[UIWindow _setHidden:forced:] + 302
25 UIKit 0x000000010d29b558 -[UIWindow makeKeyAndVisible] + 43
26 UIKit 0x000000010d216063 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 4131
27 UIKit 0x000000010d21c5a8 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1755
28 UIKit 0x000000010d219783 -[UIApplication workspaceDidEndTransaction:] + 188
29 FrontBoardServices 0x000000011097b7ac -[FBSSerialQueue _performNext] + 192
30 FrontBoardServices 0x000000011097bb1a -[FBSSerialQueue _performNextFromRunLoopSource] + 45
31 CoreFoundation 0x000000010e77c1b1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
32 CoreFoundation 0x000000010e7720dc __CFRunLoopDoSources0 + 556
33 CoreFoundation 0x000000010e771593 __CFRunLoopRun + 867
34 CoreFoundation 0x000000010e770fa8 CFRunLoopRunSpecific + 488
35 UIKit 0x000000010d2190d5 -[UIApplication _run] + 402
36 UIKit 0x000000010d21de09 UIApplicationMain + 171
37 App TV 0x000000010d0b8fdd main + 109
38 libdyld.dylib 0x00000001149699e9 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Funny thing happening, apparently the new Apple TV (4th Gen / tvOS v9.0) can't handle 'Word Wrap' on a button, after setting it to 'Truncate Middle' it starts up fine. Maybe an issue in the beta.
On Xcode 7.2 I had this same error caused by setting the Line Break on a button to 'Character Wrap'. Changing to 'Truncate Middle' stopped the crash.
You can be notified where the exception occurs by activating Exception Breakpoints, then you will be able to see what happens.
You can do so by going on the Breakpoint navigator on Xcode, then on the Plus button at the bottom left.
I'm a beginner working through Ray Wenderlich's Swift tutorial, Part 2.
The final code for the lesson (and with which I'm receiving the error) is here: http://cdn5.raywenderlich.com/wp-content/uploads/2014/06/TipCalculator-Demo4.zip
When I build the app through Xcode 6.3.2 and run it on the iOS simulator (iPhone 6), I get the error message below (sorry for the poor formatting).
I did a search on both Google and StackOverflow, seems like people often run into similar errors but are able to fix it by going to the view controller, checking the Connections Inspector, and fixing any of the connections that are flagged (e.g., an object being connected to no longer exists).
Note: I don't have any flags in my Connections Inspector -- everything seems fine there, including the connection between resultsTextView and Text View object in the Storyboard (please see attached photo)
Please let me know how to solve this - thanks.
---------See Connection Inspector on far right - looks fine!-----------
http://i.imgur.com/X6eA05F.png
---------Error message---------
2015-06-05 17:07:39.866 TipCalculator[4848:128801] * Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key resultsTextView.'
* First throw call stack:
(
0 CoreFoundation 0x0000000100216c65 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000101d81bb7 objc_exception_throw + 45
2 CoreFoundation 0x00000001002168a9 -[NSException raise] + 9
3 Foundation 0x0000000100634b53 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 259
4 CoreFoundation 0x000000010015ed50 -[NSArray makeObjectsPerformSelector:] + 224
5 UIKit 0x0000000100d8d52b -[UINib instantiateWithOwner:options:] + 1506
6 UIKit 0x0000000100be5718 -[UIViewController _loadViewFromNibNamed:bundle:] + 242
7 UIKit 0x0000000100be5d08 -[UIViewController loadView] + 109
8 UIKit 0x0000000100be5f79 -[UIViewController loadViewIfRequired] + 75
9 UIKit 0x0000000100c1601b -[UINavigationController _layoutViewController:] + 44
10 UIKit 0x0000000100c16565 -[UINavigationController _updateScrollViewFromViewController:toViewController:] + 216
11 UIKit 0x0000000100c16664 -[UINavigationController _startTransition:fromViewController:toViewController:] + 92
12 UIKit 0x0000000100c17448 -[UINavigationController _startDeferredTransitionIfNeeded:] + 523
13 UIKit 0x0000000100c17f0e -[UINavigationController __viewWillLayoutSubviews] + 43
14 UIKit 0x0000000100d62715 -[UILayoutContainerView layoutSubviews] + 202
15 UIKit 0x0000000100b35a2b -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 536
16 QuartzCore 0x0000000104916ec2 -[CALayer layoutSublayers] + 146
17 QuartzCore 0x000000010490b6d6 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 380
18 QuartzCore 0x000000010490b546 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 24
19 QuartzCore 0x0000000104877886 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 242
20 QuartzCore 0x0000000104878a3a _ZN2CA11Transaction6commitEv + 462
21 UIKit 0x0000000100ab3a2d -[UIApplication _reportMainSceneUpdateFinished:] + 44
22 UIKit 0x0000000100ab46f1 -[UIApplication _runWithMainScene:transitionContext:completion:] + 2648
23 UIKit 0x0000000100ab30d5 -[UIApplication workspaceDidEndTransaction:] + 179
24 FrontBoardServices 0x00000001038915e5 __31-[FBSSerialQueue performAsync:]_block_invoke_2 + 21
25 CoreFoundation 0x000000010014a41c __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12
26 CoreFoundation 0x0000000100140165 __CFRunLoopDoBlocks + 341
27 CoreFoundation 0x000000010013f947 __CFRunLoopRun + 887
28 CoreFoundation 0x000000010013f366 CFRunLoopRunSpecific + 470
29 UIKit 0x0000000100ab2b42 -[UIApplication _run] + 413
30 UIKit 0x0000000100ab5900 UIApplicationMain + 1282
31 TipCalculator 0x000000010002c177 main + 135
32 libdyld.dylib 0x00000001024d9145 start + 1
33 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
Make sure you follow those steps correctly:
Open Main.storyboard and select your View Controller in the Document
Outline. Open the Connections Inspector (6th tab), and you will see
all of the properties you created listed in the Outlets section.
021_ConnectionsInspector You’ll notice a small circle to the right of
resultsTextView. Control-drag from that button down to the text view
below the Calculate button, and release to connect your Swift property
to this view.
I believe you are missing the #IBOutlet that is create in this step
I'm creating an Ad enabled application, and to the most part its been successful to how I wanted it, however recently my application started crashing with an NSInvalidArgumentException error whenever I start the application, after some serious debugging I've found that the cause of the error is when my ADBannerView delegate is linked to my UITableViewController class. I've implemented the ADBannerViewDelegate to my class so I can't understand what the issue with it is. I'm trying to keep my code as private as possible to avoid my idea to be recreated. So for now I'll be posting the crash log. If any other information is needed I'll post the bare minimum of what has been asked for
2014-07-09 16:48:32.268 <APPLICATION NAME>[3491:589625] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[0]'
*** First throw call stack:
(
0 CoreFoundation 0x00ee5646 __exceptionPreprocess + 182
1 libobjc.A.dylib 0x00b878e3 objc_exception_throw + 44
2 CoreFoundation 0x00ddc513 -[__NSPlaceholderDictionary initWithObjects:forKeys:count:] + 451
3 CoreFoundation 0x00df16bb +[NSDictionary dictionaryWithObjects:forKeys:count:] + 75
4 iAd 0x00688cf5 -[ADBannerView setDelegate:] + 161
5 Foundation 0x0077ace8 _NSSetUsingKeyValueSetter + 115
6 Foundation 0x0077ac6d -[NSObject(NSKeyValueCoding) setValue:forKey:] + 267
7 UIKit 0x0131b034 -[UIView(CALayerDelegate) setValue:forKey:] + 168
8 Foundation 0x007b0166 -[NSObject(NSKeyValueCoding) setValue:forKeyPath:] + 386
9 UIKit 0x015b3589 -[UIRuntimeOutletConnection connect] + 106
10 libobjc.A.dylib 0x00b9a6f4 -[NSObject performSelector:] + 62
11 CoreFoundation 0x00e2041c -[NSArray makeObjectsPerformSelector:] + 316
12 UIKit 0x015b1b8a -[UINib instantiateWithOwner:options:] + 1775
13 UIKit 0x013e074d -[UIViewController _loadViewFromNibNamed:bundle:] + 270
14 UIKit 0x013e0ff4 -[UIViewController loadView] + 295
15 UIKit 0x015d2266 -[UITableViewController loadView] + 77
16 UIKit 0x013e1222 -[UIViewController loadViewIfRequired] + 72
17 UIKit 0x014142bd -[UINavigationController _layoutViewController:] + 42
18 UIKit 0x014147bf -[UINavigationController _updateScrollViewFromViewController:toViewController:] + 235
19 UIKit 0x014148c3 -[UINavigationController _startTransition:fromViewController:toViewController:] + 90
20 UIKit 0x0141583a -[UINavigationController _startDeferredTransitionIfNeeded:] + 669
21 UIKit 0x0141645b -[UINavigationController __viewWillLayoutSubviews] + 57
22 UIKit 0x01580c40 -[UILayoutContainerView layoutSubviews] + 213
23 UIKit 0x0131b3dc -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 601
24 libobjc.A.dylib 0x00b9a741 -[NSObject performSelector:withObject:] + 70
25 QuartzCore 0x005703e9 -[CALayer layoutSublayers] + 152
26 QuartzCore 0x00564245 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 397
27 QuartzCore 0x005640a0 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 26
28 QuartzCore 0x004c3836 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 284
29 QuartzCore 0x004c4bfc _ZN2CA11Transaction6commitEv + 392
30 QuartzCore 0x00589689 +[CATransaction flush] + 52
31 UIKit 0x0129012e -[UIApplication _reportMainSceneUpdateFinished:] + 39
32 UIKit 0x01291023 -[UIApplication _runWithMainScene:transitionContext:completion:] + 3027
33 UIKit 0x012a8eb8 __84-[UIApplication _handleApplicationActivationWithScene:transitionContext:completion:]_block_invoke + 59
34 UIKit 0x0128f77e -[UIApplication workspaceDidEndTransaction:] + 29
35 FrontBoardServices 0x06e43f1f -[FBSWorkspace clientEndTransaction:] + 87
36 FrontBoardServices 0x06e4b4ed __53-[FBSWorkspaceClient _queue_handleTransactionBookEnd]_block_invoke + 49
37 CoreFoundation 0x00e09f90 __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 16
38 CoreFoundation 0x00dff133 __CFRunLoopDoBlocks + 195
39 CoreFoundation 0x00dfe898 __CFRunLoopRun + 936
40 CoreFoundation 0x00dfe22b CFRunLoopRunSpecific + 443
41 CoreFoundation 0x00dfe05b CFRunLoopRunInMode + 123
42 UIKit 0x0128f095 -[UIApplication _run] + 571
43 UIKit 0x012926e5 UIApplicationMain + 1526
44 AppIdeas 0x0001a4ed main + 141
45 libdyld.dylib 0x02ca1ac9 start + 1
46 ??? 0x00000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
Also, I'd like to point out that I'm not using an NSPlaceholderDictionary at all in my program, nor am I using the method initWithObjects:forKeys:count:
Hopefully you guys should be able to help with this, thanks for you help
EDIT: I'd Also like to point out that All my other Pages (Part of a UITabBarController) load the ads fine, with the delegate added like the first page, it only happens on the application launch for the first view to come into focus... Is there something I'm missing?
I have updated my app to IOS7 and now I have very strange issue.
When I start app it start to do what it suppose to do and after 3-5 minutes app stops to work. But not completely. It stops to send notifications, track location etc.
And if I try to make some action I get this in console:
*** First throw call stack:
(
0 CoreFoundation 0x0305f5e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x0276e8b6 objc_exception_throw + 44
2 CoreFoundation 0x0305f3bb +[NSException raise:format:] + 139
3 UIKit 0x0157465c -[UINib instantiateWithOwner:options:] + 951
4 UIKit 0x013e6c95 -[UIViewController _loadViewFromNibNamed:bundle:] + 280
5 UIKit 0x013e743d -[UIViewController loadView] + 302
6 UIKit 0x013e773e -[UIViewController loadViewIfRequired] + 78
7 UIKit 0x0140d1a5 -[UINavigationController _layoutViewController:] + 39
8 UIKit 0x0140d6bb -[UINavigationController _updateScrollViewFromViewController:toViewController:] + 235
9 UIKit 0x0140d7b3 -[UINavigationController _startTransition:fromViewController:toViewController:] + 78
10 UIKit 0x0140e72c -[UINavigationController _startDeferredTransitionIfNeeded:] + 645
11 UIKit 0x0140f349 -[UINavigationController __viewWillLayoutSubviews] + 57
12 UIKit 0x0154839d -[UILayoutContainerView layoutSubviews] + 213
13 UIKit 0x0cf0656f -[UILayoutContainerViewAccessibility(SafeCategory) layoutSubviews] + 50
14 UIKit 0x0133edd7 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 355
15 libobjc.A.dylib 0x0278081f -[NSObject performSelector:withObject:] + 70
16 QuartzCore 0x00ef972a -[CALayer layoutSublayers] + 148
17 QuartzCore 0x00eed514 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 380
18 QuartzCore 0x00eed380 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 26
19 QuartzCore 0x00e55156 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 294
20 QuartzCore 0x00e564e1 _ZN2CA11Transaction6commitEv + 393
21 QuartzCore 0x00f12870 +[CATransaction flush] + 52
22 UIKit 0x012f0979 _afterCACommitHandler + 131
23 CoreFoundation 0x0302753e __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 30
24 CoreFoundation 0x0302748f __CFRunLoopDoObservers + 399
25 CoreFoundation 0x030053b4 __CFRunLoopRun + 1076
26 CoreFoundation 0x03004b33 CFRunLoopRunSpecific + 467
27 CoreFoundation 0x0300494b CFRunLoopRunInMode + 123
28 GraphicsServices 0x03ce89d7 GSEventRunModal + 192
29 GraphicsServices 0x03ce87fe GSEventRun + 104
30 UIKit 0x012d494b UIApplicationMain + 1225
31 MyApp 0x0000759d main + 141
32 libdyld.dylib 0x02c53725 start + 0
33 ??? 0x00000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Any idea what is this?
App works fine in IOS6.
Create an exception breakpoint in Xcode that stops on all exceptions. Then the debugger will stop when that exception is raised. It looks like it is in
[UINib instantiateWithOwner:options:]
But I can't tell if you are calling that or the system.
See here for a related issue:
Terminating app due to uncaught exception 'NSUnknownKeyException'
I must test this on real phone just to be sure.
I have a piece of code that refreshes some labels in the view every X seconds.
It works fine until IOS7. On IOS7 app crashes after 3 minutes and I get the error from the question.
Every time I refresh labels in the view I was opened a new connection to sqlite to get data.
In IOS7 I get error so I made one instance of data access class and init it only in viewDidLoad() and now it works fine.
If after test I confirm that I am right I will definitely make singleton pattern of my data access class.