Xcode Storyboard not finding any custom classes - ios

Im using custom segues and viewcontrollers in my project. Until not hooking the storyboard viewcontrollers and segues with my custom ones worked as usual. Yesterday i had to force quit xcode. Today when i try to change the class of a viewController in the storyboard view to my custom class xcode does not give me the autocomplete option, so i just fill it out manually. When i simulate the app and go the the new viewcontroller i get the error:
"this class is not key value coding-compliant for the key: button"
button is the only referenced outlet in this view (i checked it in connector inspector). all the other propsed solutions on stackoverflow to this problem did not solve it for me. it looks to me like the storyboard file is broken or something if even a single referencing outlet does not work and storyboard does not find any of my custom classes? does anyone have an idea whats happening here?

Related

Cant control drag a reference object to the ViewController in Xcode 9.2 (9C40b) iOS project

How to a create an outlet for an iOS control on the storyboard that is connected to my swift ViewController code?
All the tutorials for iOS development show that you can control drag a UI element to your ViewContoller swift code for an outlet. However it never works for me, it shows the blue line from the storyboard, but on the drop it never brings up the dialog to add a new outlet.
Creating a new Action drag and drop works just fine for buttons. I have seen many ask this question and there seems to be no definite answer.
Is there something different with iOS projects?
I tried to set the View Controller custom class to my specific ViewController class, and then I can drag and drop a new outlet. However the project fails to compile.
LaunchScreen.storyboard: error: Illegal Configuration: Launch screens may not set custom classnames
I seem to be missing something here, but all the tutorials I watch/read (none seem to cover Xcode 9 or swift 4) all show this behavior as being the normal way to create an outlet.
Launch screens are not able to have outlets attached to them. They are static. If you'd like to have a "launch screen" that you can manipulate, duplicate your launch screen layout into an initial view controller and do what you like there.
I think this is because you are connecting it from the LaunchScreen.xib instead of the main.storyboard files.

Strange Error changing ViewController

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.

Can't connect UI to ViewController using Swift 2.0 in Xcode 7.1

So I am trying to connect some UI objects to my ViewController, but it doesn't seem like they want to connect to each other. Maybe this is something to do with having two ViewControllers?
Before you ask, I already tried to remove the other ViewController and worked to no avail.
Here is a video of my issue in progress.
https://youtu.be/ha_6v92yJ6E
Probably your view controller class is not properly set. You need to go to storyboard select top yellow tab then go to Utilities on right then select Identity Inspector tab
Set your controller class name here for eg: ViewController in above image.
Hope this might help.

UIWebView IBOutlet Connection issue

So I'm going to try to explain my issue as best I can.
I have 2 View Controllers on a Storyboard. One is the "main" VC and the second is a "EULA" VC.
The main view controller has a UIWebView which loads the primary UI and works fine. This controller uses code to perform a Modal segue to the EULA VC which is created in the interface builder. This also works fine.
Now here lies my problem. The EULA view controller also has a UIWebView on it but I can't seem to connect this view controller to any connection by means of CTRL + drag. The "main" UIWebView is connected to ViewController.h
This is how I create my connection with CTRL + drag:
My question is why am I able to connect the first UIWebView on the Main view controller but not the other UIWebView on the EULA view controller? What am I missing?
Have you set up the EULAViewController.h as the custom class for the ViewController in Interface builder? Select the UIViewContoller in Interface Builder and in the third tab make sure the class is correct. Here is a screenshot explaining what I am saying:
Also make sure you have selected the correct file in the right pane, both red boxes should show the name of your custom UIViewController subclass:
I am think this is a bug in XCode or what. But this is very rare issue. I also got this issue sometime. So posting a solution which can make you little nervous to implement. But it works for me sometimes. You can try it . -
Just create a new UIViewController subclass in your project and name it something slightly different than the first. Then, copy/paste all code from old non-working UIViewController into the new UIViewController subclass (.h and .m) and change all relevant symbols according to the new UIViewController subclass name. After doing this I found everything worked as normal in terms of trying to control-drag wiring the buttons.
Happy coding. :)
Recreating the class files, renaming the view to something else then back to EULAViewController AND following these steps I was able to fix the issue.
Close the project you are working on with.
Delete the【DerivedData】folder of you project. (This folder may
inside your project's folder, or inside
~/Library/Developer/XCode/DerivedData/(your project)/ ) or somewhere
else that were setup by you.
restart you project.

Unable to set the segue identifier in XCode 4.6 because Attributes Inspector is blank

I have an iPad app (XCode 4.6, iOS 6.2, ARC and Storyboards). Everything is connected properly using segues; however, when I click on a segue, I am presented with a blank Attributes inspector. Why and how do I fix it?
Here is the structure of the app:
And here is what I see when I click on any segue:
You can't set an identifier of a segue that's created between a UINavigationController or a UITabBarController. This is expected behaviour.
Segues between other view controllers should work OK though. Try selecting a different file and then return to the storyboard or try restarting Xcode (fixes a lot of annoying problems for me).
Edit based on comment:
If I understand your UI layout (the screenshot is a bit difficult to make out fully) and problem correctly...
You'd have to create a good old fashioned IBAction method, hook up each UIButton and call setSelectedIndex: on the UITabBarController.

Resources