I know there is already a question about this, but the answer provided did not solve my problem.
For start, I had 3 three segues pointing to 3 different view controllers and coming from the AMSlideMenuLeftTableViewController class. The first segue and view controller that I created was the view that appeared as the first view (the one that shows when the app loads).
However, since I deleted that first view my app crashes immediately after opening it up.
This is the crash log:
2014-09-02 17:17:56.200 App[3174:60b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Receiver (<MenuViewController>: 0x10db0da10>) has no segue with identifier 'rightMenu''
*** First throw call stack:
(
0 CoreFoundation 0x0000000100433495 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x00000001030f499e objc_exception_throw + 43
2 UIKit 0x0000000101d99515 -[UIViewController shouldPerformSegueWithIdentifier:sender:] + 0
3 App 0x000000010002d67f -[AMSlideMenuMainViewController setup] + 1071
4 App 0x000000010002aae1 -[AMSlideMenuMainViewController viewDidLoad] + 353
5 App 0x00000001000915e6 -[MenuViewController viewDidLoad] + 54
6 UIKit 0x0000000101d9759e -[UIViewController loadViewIfRequired] + 562
7 UIKit 0x0000000101d97777 -[UIViewController view] + 29
8 UIKit 0x00000001020a22e2 -[UIClientRotationContext initWithClient:toOrientation:duration:andWindow:] + 390
9 UIKit 0x0000000101cddffa -[UIWindow _setRotatableClient:toOrientation:updateStatusBar:duration:force:isRotating:] + 1109
10 UIKit 0x0000000101cddb9f -[UIWindow _setRotatableClient:toOrientation:updateStatusBar:duration:force:] + 36
11 UIKit 0x0000000101cddaef -[UIWindow _setRotatableViewOrientation:updateStatusBar:duration:force:] + 101
12 UIKit 0x0000000101cdcdfe -[UIWindow _updateToInterfaceOrientation:duration:force:] + 377
13 UIKit 0x0000000101d9b70a -[UIViewController _tryBecomeRootViewControllerInWindow:] + 147
14 UIKit 0x0000000101cd7b1b -[UIWindow addRootViewControllerViewIfPossible] + 490
15 UIKit 0x0000000101cd7c70 -[UIWindow _setHidden:forced:] + 282
16 UIKit 0x0000000101ce0ffa -[UIWindow makeKeyAndVisible] + 51
17 UIKit 0x0000000101c9cc98 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1788
18 UIKit 0x0000000101ca0a0c -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 660
19 UIKit 0x0000000101cb1d4c -[UIApplication handleEvent:withNewEvent:] + 3189
20 UIKit 0x0000000101cb2216 -[UIApplication sendEvent:] + 79
21 UIKit 0x0000000101ca2086 _UIApplicationHandleEvent + 578
22 GraphicsServices 0x0000000104eff71a _PurpleEventCallback + 762
23 GraphicsServices 0x0000000104eff1e1 PurpleEventCallback + 35
24 CoreFoundation 0x00000001003b5679 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 41
25 CoreFoundation 0x00000001003b544e __CFRunLoopDoSource1 + 478
26 CoreFoundation 0x00000001003de903 __CFRunLoopRun + 1939
27 CoreFoundation 0x00000001003ddd83 CFRunLoopRunSpecific + 467
28 UIKit 0x0000000101ca02e1 -[UIApplication _run] + 609
29 UIKit 0x0000000101ca1e33 UIApplicationMain + 1010
30 App 0x0000000100076503 main + 115
31 libdyld.dylib 0x0000000103ddd5fd start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
I think the problem is that the app is trying to display the view I deleted as the main view but it isn't there. The fact is that I have not found any reference to that old view I deleted.
If AMSlideMenu catches an exception when trying to create LeftMenu, it then tries to create RightMenu (I don't understand why, but is true).
In my case the left menu firstSegue pointed to a 'wrong view', because it was a simple view controller, not a navigation controller. I changed the view controller to a navigation controller (that points to my original view controller), and that fixed it.
Copy the AMSlideMenuWithoutStoryboard-Prefix.pch file settings to the PCH file from your project.
Related
With ObjectiveC I am developing a SingleView app targeting iOS 11 having one view controller/view. In the Main.storyboard on top of the view I've dropped a WebKit View (WKWebView).
I am seeing a crash in both the Simulator and on an iPhone 6 running iOS 11.0.1 :
Terminating app due to uncaught exception 'NSInvalidUnarchiveOperationException', reason: 'Could not instantiate class named WKWebView'
Do I need anything else to have it working ? Looks like it's unable to instantiate WKWebView upon waking from storyboard.
Other details:
Xcode version 9.0 9A235
When I remove the WKWebView from the Storyboard the crash goes away
App Base SDK - latest iOS (iOS 11); Deployment target 11.0
Using the WebView(deprecated) -- UIWebView, it works
I did not attempt to instantiate it manually
Crash stack:
2017-11-06 18:38:27.765519+0200 XYZZMap[15689:1093338] *** Terminating app due to uncaught exception 'NSInvalidUnarchiveOperationException', reason: 'Could not instantiate class named WKWebView'
*** First throw call stack:
(
0 CoreFoundation 0x00000001056d01cb __exceptionPreprocess + 171
1 libobjc.A.dylib 0x0000000105032f41 objc_exception_throw + 48
2 CoreFoundation 0x0000000105744b95 +[NSException raise:format:] + 197
3 UIKit 0x000000010692d2c0 UINibDecoderDecodeObjectForValue + 323
4 UIKit 0x000000010692d5db UINibDecoderDecodeObjectForValue + 1118
5 UIKit 0x000000010692d172 -[UINibDecoder decodeObjectForKey:] + 89
6 UIKit 0x00000001062f866b -[UIView initWithCoder:] + 969
7 UIKit 0x000000010692d43d UINibDecoderDecodeObjectForValue + 704
8 UIKit 0x000000010692d172 -[UINibDecoder decodeObjectForKey:] + 89
9 UIKit 0x00000001066dd1a7 -[UIRuntimeConnection initWithCoder:] + 178
10 UIKit 0x000000010692d43d UINibDecoderDecodeObjectForValue + 704
11 UIKit 0x000000010692d5db UINibDecoderDecodeObjectForValue + 1118
12 UIKit 0x000000010692d172 -[UINibDecoder decodeObjectForKey:] + 89
13 UIKit 0x00000001066dc3a4 -[UINib instantiateWithOwner:options:] + 1262
14 UIKit 0x00000001063f8d07 -[UIViewController _loadViewFromNibNamed:bundle:] + 383
15 UIKit 0x00000001063f9610 -[UIViewController loadView] + 177
16 UIKit 0x00000001063f9941 -[UIViewController loadViewIfRequired] + 195
17 UIKit 0x00000001063fa19e -[UIViewController view] + 27
18 UIKit 0x00000001062cdd17 -[UIWindow addRootViewControllerViewIfPossible] + 122
19 UIKit 0x00000001062ce41f -[UIWindow _setHidden:forced:] + 294
20 UIKit 0x00000001062e12bf -[UIWindow makeKeyAndVisible] + 42
21 UIKit 0x0000000106255015 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 4711
22 UIKit 0x000000010625a245 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1720
23 UIKit 0x0000000106615c6c __111-[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:]_block_invoke + 924
24 UIKit 0x00000001069e33ef +[_UICanvas _enqueuePostSettingUpdateTransactionBlock:] + 153
25 UIKit 0x0000000106615865 -[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:] + 249
26 UIKit 0x00000001066160c3 -[__UICanvasLifecycleMonitor_Compatability activateEventsOnly:withContext:completion:] + 668
27 UIKit 0x0000000106f73c11 __82-[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:]_block_invoke + 262
28 UIKit 0x0000000106f73aca -[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:] + 444
29 UIKit 0x0000000106c61b9c __125-[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:]_block_invoke + 420
30 UIKit 0x0000000106e5cc3e _performActionsWithDelayForTransitionContext + 100
31 UIKit 0x0000000106c61998 -[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:] + 231
32 UIKit 0x00000001069e2a4c -[_UICanvas scene:didUpdateWithDiff:transitionContext:completion:] + 392
33 UIKit 0x0000000106258ac6 -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 523
34 UIKit 0x0000000106821523 -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 369
35 FrontBoardServices 0x000000010b539158 -[FBSSceneImpl _didCreateWithTransitionContext:completion:] + 338
36 FrontBoardServices 0x000000010b541c4d __56-[FBSWorkspace client:handleCreateScene:withCompletion:]_block_invoke_2 + 235
37 libdispatch.dylib 0x00000001096b643c _dispatch_client_callout + 8
38 libdispatch.dylib 0x00000001096bbaf4 _dispatch_block_invoke_direct + 592
39 FrontBoardServices 0x000000010b56d672 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 24
40 FrontBoardServices 0x000000010b56d328 -[FBSSerialQueue _performNext] + 464
41 FrontBoardServices 0x000000010b56d897 -[FBSSerialQueue _performNextFromRunLoopSource] + 45
42 CoreFoundation 0x00000001056732b1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
43 CoreFoundation 0x0000000105712d31 __CFRunLoopDoSource0 + 81
44 CoreFoundation 0x0000000105657c19 __CFRunLoopDoSources0 + 185
45 CoreFoundation 0x00000001056571ff __CFRunLoopRun + 1279
46 CoreFoundation 0x0000000105656a89 CFRunLoopRunSpecific + 409
47 GraphicsServices 0x000000010be609c6 GSEventRunModal + 62
48 UIKit 0x000000010625bd30 UIApplicationMain + 159
49 XYZZMap 0x00000001047274bf main + 111
50 libdyld.dylib 0x0000000109732d81 start + 1
51 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Thanks!
NSInvalidUnarchiveOperationException when loading the nib / storyboard means there an object in the nib / storyboard that the runtime doesn't understand. This is because the framework that defines that kind of object is missing.
So, in this case, you need to link your app target against the WebKit framework so that the app understands what a WKWebView is when it is decoded from the storyboard.
Here's a screen shot showing the app target's Build Phases when this is correctly configured:
Select Target -> General -> Linked framework and libraries -> click on + symbol below -> search for webKit.Framwork -> add.
Update for swift 5.0 ++
And Xcode- 11.5 +
If you faced this issue which I mentioned below after linked WKWebView in storyboard.
NSInvalidUnarchiveOperationException', reason: 'Could not instantiate
class named WKWebView because no class named WKWebView was found; the
class needs to be defined in source code or linked in from a library
(ensure the class is part of the correct target)
Just follow this instruction to solve this in new Xcode.
Here's a screen shot showing the project target's Build Phases when this is correctly configured:
Check whether on the storyboard you have a WKWebView instance while in code you may have a UIWebView instance
Click on Project Target and then add webKit.Framwork as display below :
General -> Linked framework and libraries -> click on + symbol below -> search for webKit.Framwork -> add.
I too faced same kind of issue.
Without declaring WKWebView as Outlet
Got this error while running in simulator
After adding Outlet it worked fine for me.
Hope this helps :)
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've got a tab ViewController(A) with 5 child view controllers(B) i want to pass from one of my child view controller to another view controller that i've got in my storyboard (C)
I made a button in a child view controller(B) and linked it to my (C) with push in my storyboard but when i click it this is what i get:
2015-07-04 16:04:36.641 LoginSampleFB[1447:74036] *** Terminating app due to uncaught exception 'NSGenericException', reason: 'Push segues can only be used when the source controller is managed by an instance of UINavigationController.'
*** First throw call stack:
(
0 CoreFoundation 0x000000010d2c2c65 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010cf5bbb7 objc_exception_throw + 45
2 UIKit 0x000000010bd37d72 -[UIStoryboardPushSegue destinationContainmentContext] + 0
3 UIKit 0x000000010b7ead62 -[UIApplication sendAction:to:from:forEvent:] + 75
4 UIKit 0x000000010b8fc50a -[UIControl _sendActionsForEvents:withEvent:] + 467
5 UIKit 0x000000010b8fb8d9 -[UIControl touchesEnded:withEvent:] + 522
6 UIKit 0x000000010b837958 -[UIWindow _sendTouchesForEvent:] + 735
7 UIKit 0x000000010b838282 -[UIWindow sendEvent:] + 682
8 UIKit 0x000000010b7fe541 -[UIApplication sendEvent:] + 246
9 UIKit 0x000000010b80bcdc _UIApplicationHandleEventFromQueueEvent + 18265
10 UIKit 0x000000010b7e659c _UIApplicationHandleEventQueue + 2066
11 CoreFoundation 0x000000010d1f6431 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
12 CoreFoundation 0x000000010d1ec2fd __CFRunLoopDoSources0 + 269
13 CoreFoundation 0x000000010d1eb934 __CFRunLoopRun + 868
14 CoreFoundation 0x000000010d1eb366 CFRunLoopRunSpecific + 470
15 GraphicsServices 0x000000010fab8a3e GSEventRunModal + 161
16 UIKit 0x000000010b7e98c0 UIApplicationMain + 1282
17 LoginSampleFB 0x000000010b4533ef main + 111
18 libdyld.dylib 0x000000010db5a145 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
You should add UINavigationControllers as your tabs, and use the ViewControllers (B) as roots for these navigation controllers. Only that way can you perform a push. Otherwise you have to use a modal presentation which will cover partially or entirely your Tab bar controller.
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 assigned a button to push a segue to another view controller but when I execute this part of the code I get the following:
2014-02-20 10:44:29.357 nar[20244:70b] *** Terminating app due to uncaught exception 'NSGenericException', reason: 'Push segues can only be used when the source controller is managed by an instance of UINavigationController.'
*** First throw call stack:
(
0 CoreFoundation 0x017395e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x014bc8b6 objc_exception_throw + 44
2 UIKit 0x0076eca5 -[UIStoryboardPushSegue destinationContainmentContext] + 0
3 UIKit 0x0075f07e -[UIStoryboardSegueTemplate _perform:] + 174
4 UIKit 0x0075f0f9 -[UIStoryboardSegueTemplate perform:] + 115
5 libobjc.A.dylib 0x014ce874 -[NSObject performSelector:withObject:withObject:] + 77
6 UIKit 0x0022c0c2 -[UIApplication sendAction:to:from:forEvent:] + 108
7 UIKit 0x0022c04e -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 61
8 UIKit 0x003240c1 -[UIControl sendAction:to:forEvent:] + 66
9 UIKit 0x00324484 -[UIControl _sendActionsForEvents:withEvent:] + 577
10 UIKit 0x00323733 -[UIControl touchesEnded:withEvent:] + 641
11 UIKit 0x0059ec7f _UIGestureRecognizerUpdate + 7166
12 UIKit 0x0026919a -[UIWindow _sendGesturesForEvent:] + 1291
13 UIKit 0x0026a0ba -[UIWindow sendEvent:] + 1030
14 UIKit 0x0023de86 -[UIApplication sendEvent:] + 242
15 UIKit 0x0022818f _UIApplicationHandleEventQueue + 11421
16 CoreFoundation 0x016c283f __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
17 CoreFoundation 0x016c21cb __CFRunLoopDoSources0 + 235
18 CoreFoundation 0x016df29e __CFRunLoopRun + 910
19 CoreFoundation 0x016deac3 CFRunLoopRunSpecific + 467
20 CoreFoundation 0x016de8db CFRunLoopRunInMode + 123
21 GraphicsServices 0x036de9e2 GSEventRunModal + 192
22 GraphicsServices 0x036de809 GSEventRun + 104
23 UIKit 0x0022ad3b UIApplicationMain + 1225
24 w1nnar 0x00002f2d main + 141
25 libdyld.dylib 0x01d7770d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
And I get taken to my main file main.m and it highlights the following:
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
Not sure what the issue is?
Suggestions and thoughts?
You're trying to push from a UIViewController not being embed in a UINavigationController.
What you need to do is go to your storyboard, select the UIViewController you're trying to push from, go to the Editor menu, select Embed in, and Navigation Controller. Then you can push other UIViewControllers on it.
For information on navigation in iOS apps, read Apple's documentation.
You need a UINavigationController to embed your current view. Since Segues use navigation controllers to push other view controllers on top of it.
If you're using a storyboard, add a UINavigationController and embed your view in it.