In the image see the highlighted portion .swift(Interface), When I get this it makes me unable to drag and connect from storyboard to viewcontroller class.
I have searched but not getting any clue that what is the issue behind this.
Can anyone help regarding this?
I have tried, clearing cache, cleaning the build, restarting the MBP etc but nothing helped.
I am unable to solve it out.
Rather than choosing "manual" and selecting the interface, you might use "automatic" and when you select the control in IB, you should see the actual .swift file (not the interface) in the assistant editor, and you should be able to control-drag at that point.
And you didn't mention it, but if you ever have troubles hooking up outlets, double check that the base class has been properly set in IB before you try hooking up outlets.
This is a Xcode bug, update to 8.3.2 to see if it fixes your problem (it doesn't show up on the app store update sometimes, so manually download it)
Related
When I ctrl-drag an object from the storyboard to code in the assistant editor I get this error:
I've googled the hell out of this problem and tried every suggestion that I could find. I restarted XCode, restarted my computer, updated XCode, deleted and re-added files, etc. and nothing is working. I saw suggestions to manually write the code and then drag from the circle in the gutter to the object I want to connect to in the storyboard. This would be a fine solution, but for some reason the outlet isn't showing up.
Normally the outlet would be to the left of the line number in the gutter
I am not sure what to do at this point except cry. If anyone has any suggestions or help to offer that would be greatly appreciated.
I was trying to rename an app like I regularly do. I go to the project title at the top left, double tap, and rename the app.
It usually works. However, this time, I have come across a Signal Sigabrt. I tried renaming the project only, but that doesn't work. All of the connections seem to be correct. Here is my error.
This is the first time I have come across a Signal Sigabrt for this reason. Could someone show me what I am doing wrong? Thanks.
Update
When I keep the name of the project the same as the original one, the app runs fine. If I change it to the new one, the app crashes. What should I do?
The screenshot you posted indicates problem in one of your Interface Builder files. Most likely the outlet connections defined there are not correct anymore.
This is a long shot suggestion, but have you been adding and removing objects to the view, or creating and renaming your Outlets? Sometimes this can result in outlets in the xib file which no longer exist in the header or implementation files (I can't explain why this is, although I'm sure there's a reasonable explanation.)
In any case, with the Interface Builder open check the Connections Inspector, which is the button all the way to the right in the Utilities panel. Make sure there are no lingering outlets or actions over there which are not linked to any objects. You may need to cycle through the objects in your view,even the view itself, to make sure you aren't missing any. If there are any of them listed, delete them and try to run the app again.
Today I tried to use a container view in Xcode and when I searched in the bar at the bottom of the Library menu, I could not find it. I have also searched through the entire list and can not find it.
Does anyone have any idea what might be occurring. I am using Xcode 6.4.
Any suggestions will be much appreciated.
It looks like the reason I can't find it is because I am using XIB's and not a storyboard (which is what I used in the past when I used a container view).
Thanks to the other answers which helped me come to this conclusion.
I am using Xcode V6.4 and searched by the name UIContainer/container in the object library section of utilities. and It is showing the container view.
You can find it in your storyboard. See image bellow.
This is definitely a bug that is still present in Xcode 7.3.1.
However, I kept playing with switching tabs and looking into other storyboards to see if I could make it find it from a different file. It turns out that after a navigating thru some of my storyboards and seeing the storyboard form the main editor (instead of doing it from the assistant editor) I was able to find it.
Hope this helps!
Oddly, there seems to be a bug in Xcode 6.4. Once I changed the tab in the lower right navigator and came back to the Objects tab, the search/filter worked again. I had the same exact problem in the same exact version of Xcode.
Like kriztho said, container view won't be listed in the object library when viewing storyboard from the assistant editor for some stupid reason. I'm using Xcode 9, and this is still an issue. Right when I switched storyboard to the standard editor (Cmd + return on Mac), the container view was listed once again in the object library.
I cant see the Labels, Button etc in the View or their constraints though the Labels and Button appears on the side of the storyboard. And when you run the program in the simulator you can see that they are there.
The project from my colleague who uses XCode 6.3.1 and I am using XCode 6.3.2
and he doesn't have this issue. When he updated his to to the same version I have he had the same problem; so he went back to the previous version 6.3.1.
Now the problem persisted on my device even when I removed the 6.3.2 and substitute it with 6.3.1
stackoverflow prevented me from uploading the images but I can send it by email to anyone to see the screen shots
I think I found the answer but yet the labels seems to be shifted out of the view. but the Answer is: This problem occurs when one of the users design the view controller using the compact or any other dimension other than Any X Any. to fix the problem, click in any of the objects created ( label, button..etc), and go the attribute inceptor, and scroll down to the bottom and you will find a check box with the word installed. there will probably be more than one. Look for the one that is not highlighted, and highlight it. This should fix the problem.
Another faster solution instead of going over each object you can deselect
Use Auto Layout
Use Size Classes
then select them again
My Xcode project using a storyboard entered in a very weird state recently: Xcode keeps building the whole project and notably the storyboard after each keypress. I found no reason for this behavior neither in my project diffing all interesting files (storyboard and project) neither a setting in Xcode (maybe I just could not find it?) Needless to say that this "feature" makes working on my project nearly impossible since the CPU is constantly occupying with rebuilding the storyboard when I type new code. Anybody seen this?
It is caused by the IB_DESIGNABLE definitions in the source header files. Probably it makes problem only if the header file containing IB_DESIGNABLE is included (even implicitly) to the source file you are currently editing.
I did not find a definitive solution how to disable IB_DESIGNABLE and thus compiling the storyboard and the source files continuously. I would appreciate an Xcode flag to disable this temporarily. I tried also surrounding the IB_DESIGNABLE with #ifdef macros but they are considered even if the #ifdef evaluates to false. Commenting out one by one the IB_DESIGNABLE helps but it is not a feasible solution with many IB_DESIGNABLEs.
Update
I finally found a quick way to avoid this annoying behavior. Having the storyboard opened in the active window, disable "Automatically Refresh Views" from the Editor menu. This will stop updating the views in the storyboard editor that use your custom code and thus speed up your development significantly. When you need again the just-in-time compiling to have a visual preview of your custom code, enable this option again (it seems you also have to re-open your storyboard to make it working again).
You may wish to add a key binding to the command, such as command-option-control-A, to easily toggle the behavior on/off. To add a key binding in Xcode, touch command-comma for preferences, choose the Key Bindings tab, use the search bar to find the command, then double-click on the right area to add your desired keystroke.
"Leave it off" approach
Alternately turn "Automatically Refresh Views" off, and never turn it on.
Make a convenient keystroke for "Refresh all views", say command-option-shift-R
As you work, just touch command-option-shift-R from time to time, or as needed. It's generally only necessary to touch command-option-shift-R as you work on the storyboard.
I had this problem and the accepted answer did not work for me.
The problem I had was that I always keep the storyboard open in it's own tab within XCode so that I can access it quickly.
The only way I could fix it was to either close that tab or select a different file (like a normal code file) and then close and reopen XCode. Thereafter it was no longer rebuilding on each keystroke.
Be warned however if you need to open the storyboard to make changes then this problem can sometimes reappear and I will have to repeat the above process.
Can't wait till Apple fixes this as it is very frustrating indeed!
(ノಠ益ಠ)ノ彡┻━┻