I can not drag anything to the code from the storyboard. Files were in assistant editor under automatic but now there gone how do i get them back other then deleting and recreating them? Opening them up under manual it will come up but Xcode can't find the referance when dragging to the code and i get the error when naming it.
I don't know if anyone else is still having this issue, but I get it a few times a week on Xcode 6.1.1 and I usually do the following to fix it (once I have checked that there are no class name mismatches):
Clean build
Delete Derived Data (using Organiser)
Force Quit Xcode
Re-open and Build
I know this is crazy, but it continues to work for me o_O
The most common cause is a mismatch between your class name and the name registered in the identity tab of the view controller. This will happen if you for example rename your class but don't update the classname in the storyboard.
To set/check the class name, open the storyboard and click on the leftmost icon in the titlebar of your UIViewController. Then open the identity inspector in the utility pane (right side) and double check the name given as the custom class.
The issue is due to not completion of indexing - so there are few alternatives, that you can try for-
Way 01 : Check if indexing is showing in processes - then let it complete. Then, close the editor and reopen it
Way 02 : Just perform the clean action. It will start showing appropriate Viewcontrollers.
Way 03 : This is the most effective way - Just perform "Build" and then restart editor - it will surely going to work.
I had the same problem, and I managed to solve it by selecting the correct Target on the File Inspector of both files (Swift and XIB in my case, you can check the file inspector in the storyboard).
It can happen if your project has a lot of targets (mine had a few, the file was checked on the wrong one).
You'll want to turn XCode indexing 'on' and set the Assistant editor to “Automatic”. This helped in my situation when the other suggested answers didn't. Details on turning on indexing at Stopping xcode from indexing
I just deleted build folder completely.And it works for me!
Related
My project runs good in Xcode 11. But when I build it in Xcode 12 gets the above error. I have been struggling for a while and no answers worked for me.
Please help
Thank you
It's quite an old question, but I was struggling with such issue for a few hours today and in my case it was related to the version of the tools that is declared in xib's document structure. To fix it, take a toolsVersion value from any newly created xib file (either in your current project, or a new one), then open failing xib with any code editor (or view its source in Xcode) and replace toolsVersion with the acquired one.
In my case the old version was 18122 and the valid one is 20034.
Old question but I ran into this the other day and wasn't really finding any direct solutions.
What appears to have worked for me was correcting the "builds for" value in Interface Builder. The xib file was from a project that supports a level of iOS several versions later than the project I was copying it into, and there were elements within the interface (like stack views) that weren't supported in the older OS. Once I changed the "builds for" value to an OS version that does support those UI elements, the problem went away (note that this subsequently required me setting up version checks in and around the files associated with the xib to only allow access if the user's device meets the minimum "builds for" value set on the xib).
If you're unsure where the "builds for" picker is:
In Xcode, select the xib file, and select the File Inspector within the Inspector pane (pane on the right hand side). Set the builds for value to an OS that supports all elements used within the xib, and see if that clears up the error.
I am building an app right now and using storyboards for the user interface. Storyboards were working great until about a week ago. Suddenly, they began to give me trouble. I posted a couple of Stack Overflow question regarding issues about storyboards. I have been experiencing all of the following issues:
Actions connect as AnyObject instead of Any when connecting them from storyboard.
I receive an error unrecognized selector sent to instance 0x7fb80e92bc00 due to objects not connecting from storyboard to source code.
Unwind Segues do not work. When I try to connect one, it doesn't even show any available.
I cannot select any of my UIViewControllers from the dropdown menu under the Identity inspector which I discussed more about in this question.
Inherit module from target does not get automatically selected in Interface Builder.
Here are the following things I have tried:
Clean the build folder.
Restart Xcode.
Restart my MacBook.
Delete derived data.
Tried a different storyboard.
Deleted some of the files that were giving me trouble (which is no longer an option as all files are giving me trouble).
New issues pop up everyday and it is getting more difficult to build my app when these issues occur. Why is this happening and is there any solution available?
I am facing the same issue in Xcode beta version. It generally facing when create new file. I resolved by following steps
Remove File reference
Add file again. (If file add with "copy" suffix, delete original file from source folder remove "copy" from file name)
Now try to connect with your reference, it will work
When I right click to add a new file (or do File -> New -> File), I don't get a dialogue box asking me which Template I want to use. It just creates a blank file like this:
I tried renaming it to a .swift file and adding in all the necessary code to start off, but two things happen:
First, the autocomplete function is one step behind. So when I've already typed import UIKit and moved on, it starts trying to autocomplete UIKit. And when I've already typed class className: UICollectionViewController {
} and moved on, it starts trying to autcomplete UICollectionViewController
After I manually type in the bare minimum needed to make a swift file into a UICollectionViewController with a colored background, I can't reference it in my other files.
I can only assume this is because of the lack of a template dialogue box, but maybe I'm wrong. Is there any way to toggle this template dialogue box on or off?
This problem is only happening with this particular project since I updated to Xcode 10.1
I can't seem to find anyone else online who's already had this issue. The only similar questions I found online were referring to creating reference folders rather than groups. I didn't find anything regarding the file template dialogue box not showing up.
I fixed this and I'll post the answer in case anyone else comes across this problem.
It was tedious, but I:
Created a new project
Initialized my podfile, added what was in the previous one, and installed it
Opened up the new workspace
Added each file one by one
Maybe there's an easier/quicker way to do it, but after looking through all the settings and not finding anything, I ended up doing this and it worked.
Check that in the left hand pane displaying your project structure you are adding the new file to a folder which comes under your application (identified by a blue Xcode application icon) instead of a general folder as your top level (identified by a blue folder icon). I can't add images yet so please see link.
My Xcode iOS project is kind of broken I think.When I create a new file in my group,the file's location is somewhat different from other Xcode iOS project.For example,when I create a Cocoa Touch Class called EEViewController,you can find its location is too long in the Identity and Type of the File inspector.
But when I right click the file and click Show In Finder,drag the file to the desktop and drag it back the its original group.The location's patch seems to be okay.(It can finally be referenced in Storyboard custom class)
I think it is has something to do with my Xcode configuration,but I just can't figured it out.Hope someone can help me.
To my understanding, ../../../benson/OneHome/OneHome/EEViewController.swift is relatively the same as just EEViewController.swift in your case as it's based on the location related to the group.
../ means go up 1 level in the path, up 3 level then dive in 3 makes it the same path.
I think the issue here is the case of your home dir. In the second screenshot it shows "Benson" and the first shows "benson". OS X is a case sensitive file system, that might be a problem for Xcode.
As the title suggests I am getting the error that two view controllers have the same identifier but the problem is, they don't! I have checked through all my storyboards multiple times and never saw any with the identifier! The full error is
Two view controllers have the same storyboard identifier "IAC".
Not only that, but there are no storyboards with the identifier "IAC". Its possible I may have named one that a long time ago but their certainly aren't any now. I also just updated Xcode to the ios 7.1 SDK and it's possible that's part of the error. Does anyone know why?
In that case, press Command + Shift + F and then type the identifier that is being mentioned in the Warning / Error area.
Here after you search there will be list of matches, in that select Storyboard icons, and your answer lies there.
remove derive data from Xcode -> Prefrences -> Locations -> DerivedData and rerun the project
Have you already tried cleaning your project temp and caches files and restarting Xcode? Sometimes this simple step can solve problems like this.
I got same error in my application. I could not find any information regarding this in web.
I have cleaned and deleted derived data nothing could not help me.
After some time I found solution for this.
I have assigned one story board identifier to two view controllers in scene(where we can see entire views at one place) in my application. After some time I realised this error and solved it.
goto->storyboard scene->click on view controllers and observe the identity inspector in the control panel.
if you assigned the same story board identifier to 2 or more view controllers then remove it.
Delete viewController name which is assigned for 2 or more view controllers in the Identity inspector. I hope I am able to make everyone understand.
In that case, press Command + Shift + F and then search by type the identifier that (exam problem search by name "IAC")
you will see duplicate data after you see that you choose delete and build again.