I have been at this for sometime now and all I can find is simple Segues via google. I will do my best to show you what I am trying to do and provide snapshots as to what I am doing.
The middle controller is a simple segue to the map. It will be the root. I created a new file "Cocoa Touch Class"
Now I created a IBOutlet to the "Cocoa Touch Class" I just created for the map.
Now I get an error:
libc++abi.dylib: terminating with uncaught exception of type
NSException
Am I adding the controllers incorrectly? I am not sure what I am doing wrong.
The root or "Home" will send the user to many different pages depending on what they press. From my understanding user each page will be its own view like I am trying to do above. However I feel I am doing something wrong, I am just not sure what it is.
I think it's because in storyboard you have created UIViewController and attached it to UITableViewController. Try change Base class for your controller from UITableViewController to UIViewController.
Related
I am making an iPad app that, among other things contain a view in which to set options.
This "Options" View has two container-views, each holding a TableView with two different kinds of options in them, and switches to turn these options on or off.
The problem is that when I try to make a button from my main ViewController that will open the options view, I get the following error:
Screenshot of signal SIGABRT error
with this in the output:
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UITableViewController loadView] instantiated view controller with identifier "UIViewController-c2d-Su-6Id" from storyboard "Options", but didn't get a UITableView.'
I don't know why the underlying function [UITableViewController loadView] is used, as I do not expect my Options-view to be a TableView - the tables are in container views.
I am using different storyboards, and a segue to a storyboard reference to present the Options View modally. I have tried deleting both the button, the segue and the Storyboard reference, replacing them with new ones, and renaming my ViewController.swift file, and all the references to it, with no luck
I have also tried looking for other solutions here on the site, but I have had no luck, and I begin to fear it might be because of the tableViews in the containerViews...
I am quite new to learning swift and Xcode, so please keep your explanations simple to follow, and assume that I am completely incompetent :-)
I'm guessing you probably added a Container View, which automatically places a "child" view controller onto the Storyboard, and then simply changed the Class of that child VC to UITableViewController --- which, as you found out, doesn't work.
To use a table view controller as the child, add your Container View, then add a normal UITableViewController to the Storyboard. Then, Ctrl-Drag from the Container View to the new table view controller and select Embed from the popup menu.
I got a strange error in my app. ( Maybe Xcode bug).
In my App I have a UITabBarController as initial viewcontroller.
One of my UIViewController connected with tabbarcontroller have an UIButton where I want change viewcontroller on click. So using Storyboard I have used the show feature but when I press the button this is the error:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Storyboard () doesn't contain a view
controller with identifier 'UIViewController-ned-kA-ouy''
I've search on stackoverflow and tried to fix my issue adding a Storyboard ID but nothing is changed.
I've tried to create a new project and do the same. And it's work without anything. So, whats is happening?
Xcode Version 7.2
I simply tried to copy and paste in another directory the project and now it works.
I hope to help anyone encountered that Xcode BUG.
This is not a xcode bug. You might have changed the type of viewController somewhere while creating the Main.Storyboard
Similar error can be reproduced.
Create a new project. Delete all view controllers from Main.Storyboard.
Add a UITableViewController to Storyboard and set it to Initial view controller. Add necessary DataSource and Delegate.
Now try to change the Controller type from UITableViewController to UIViewController.
If you observe now, it'll give something similar kind of error.
Now for your answer. If while copying the code to another project, have you copied the Main.Storyboard too. If not, then the creation of Storyboard was proper during the second time. You might have changed the class while creating for the first time.
I'm new to view controllers with OpenGL, but I want to present a view controller with two child view controllers (the user only sees the two child view controllers) which both display some graphics using OpenGL.
I have no idea why what I'm doing is not working. This is hard to describe in code, as there really isn't any, but I've got a Storyboard where I have my initial UIViewController, two container views each taking up half the vertical space, which then point to each of their UIViewControllers that have a GLKView making up the main view.
I don't even have any code yet, but whenever I run it, the app opens and then immediately crashes stating:
* Terminating app due to uncaught exception 'NSInvalidUnarchiveOperationException', reason: 'Could not instantiate class named GLKView'
Here's a sample project where it's failing: http://speedyshare.com/v8YCy/download/GLTest.zip
How do I accomplish OpenGL-based view controllers as child view controllers?
I didn't download your project, but the problem is almost certainly that you didn't add the GLKit framework to your project. Go to your project's settings (the blue icon at the top of the project navigator) and scroll to the bottom ("Linked Frameworks and Libraries"), and click the "+" button. You can add the framework from there.
I'm trying to implement (what I thought would be) a straightforward, full-screen, four-pane iPad app interface by using container views. I have a simple root UIViewController containing a single view, in which are four container views, each with an embedded view controller (two panes each having a UITableViewController, and two panes each having a UIViewController). This was a breeze to create in Interface Builder, but when I run the app I get the following errors, apparently when the first embed segue is performed (i.e., after prepareForSegue is called with the embed segue for one of the two UITableViewControllers, but, apparently, before viewDidLoad is actually called on that UITableViewController):
* Assertion failure in -[UIStoryboardEmbedSegue perform], /SourceCache/UIKit_Sim/UIKit-2380.17/UIStoryboardEmbedSegue.m:18
* Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'containerView is required.'
Has anyone got a clue what I'm doing wrong? I can't seem to find any mention of this "containerView is required" error anywhere.
Thanks!
Well, I figured it out, and it had nothing to do with container views. Rather, I was inadvertently reusing a navigation controller subclass that I developed for the iPhone version of the app as the root view controller of the iPad version; and since a navigation controller does of course need a container view (which the root view controller in the iPad version does not have), it resulted in the error given. I'm leaving this up here in case anyone else encounters this rather cryptic error and made the same mistake I did!
We have a framework that we generally use with our iOS projects that includes all of our login information and stuff like that. It was created before iOS5 and therefore did not use storyboards. We are now planning to move into storyboards. I created the initial view Controller, exactly like the xib in another project. Then I set the view controller in the Identity Inspector and hooked in all of the outlets and actions from the Connections Inspector. However, when I run the project, I get the following error:
2012-09-14 08:46:15.366 Mixable[3923:f803] Unknown class LoginViewController in Interface Builder file.
2012-09-14 08:46:15.460 Mixable[3923:f803] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIViewController 0x6851200> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key loginBtnFacebook.'
*** First throw call stack:
(0x14b1022 0xeb1cd6 0x14b0ee1 0x9c2022 0x933f6b 0x933edb 0x94ed50 0x23671a 0x14b2dea 0x141c7f1 0x23526e 0xdb1fc 0xdb779 0xdb99b 0x3a401 0x3a670 0x3a836 0x4172a 0x12596 0x13274 0x22183 0x22c38 0x16634 0x139bef5 0x1485195 0x13e9ff2 0x13e88da 0x13e7d84 0x13e7c9b 0x12c65 0x14626 0x201d 0x1f85 0x1)
terminate called throwing an exception
and if I remove the connection to the loginBtnFacebook, I just get it for the next outlet that I have hooked up, and that continues until I remove all outlets.
Is it possible to use the same View Controllers or will we need to rewrite all of them?
In answer to your question, the view controllers are largely the same (except which init methods are used, e.g. you obviously don't use initWithNibNamed with storyboards, but this seems unrelated to your problem here).
So, a couple of questions related to your error, which is the typical symptom of outlet linking issues:
Have you configured your scene's view controller class? Click on the view controller button at the bottom of the scene, click on on the "Identity inspector" tab button at the top of the right panel, and make sure you specify your view controller class.
Are you IBOutlet's hooked up correctly? When you click on the "Assistant Editor" in the right side of the toolbar, you should see the .h file for your class show up at the bottom. Do you have solid black dots next to the IBOutlet definitions ensuring that everything is hooked up?
This is unlikely to be the issue, but have you included the view controller's .m file in the "Compile Sources" section of "Build Phases"?