I have a project in xCode 6 using Swift (my very first experience developing iOS Apps).
I was having problems with gestures (they are alive even after removing them from storyboard) and decide to delete the ViewController I was having problem. The program compiled as it still exists. Then I decide to delete and remove reference to file main.storyboard and everything works just as before.
I believe that is related to source control
Where are those view controllers and even the storyboard stored?
By using the storyboard, sometimes you are creating some link between your elements and/or some part of your code.
These links will still be, even after deleting the element unless you delete the link itself.
In order to perform good deletion, you should first right click on the element you want to delete and suppress all its links. Then you can safely delete your element:
Related
I am facing a really weird storyboard issue. I am using Version 8.0 (8A218a) . For one of my projects, I have two storyboard files, one for iPhone and one for iPad.
Both storyboards are behaving insanely: I open a storyboard file and make changes to a ViewController's view, then I save. I run the application and every thing is OK.
I switch to another file then open the stoyboard file again, and it loads back the old view! (changes subviews locations, to the left after I center them, the same subviews every time).
To track down the issue :
1- I made a copy of the project, cleaned, deleted derived data. Did not solve.
2- I thought about Source Control, so I disabled Git. Did not solve.
3- Unless it is a common bug, I am out of options.
The problem is that it does this in each of my 2 storyboard files. And when I open one and fix it them switch back to the second, I find it changed!
Did anyone face this weird issue with storyboard?
Any explanation and/or suggestion to solve it please?
I've recently added many language localizations (localizable strings) to an Xcode (7.3.1) project.
Since around that time, working with the storyboards in Xcode has been incredibly difficult, and Xcode at times has been very unresponsive. Typically when working with storyboards the mouse turns into a colorful spinning pinwheel for about 5 seconds, then I get a few seconds where I can work, until the spinning pinwheel shows up for another 5 seconds again.
When editing swift code, where code is the only window onscreen, this issue doesn't seem to occur, the issue only seems to occur when editing the storyboard and only ever since it seems after adding localizations.
In fresh new projects, projects with no localizations, there are no such issues, project storyboards can easily be edited with no long interrupting pauses.
I've tried deleting the Derived Data folder and that didn't improve things. I'm considering removing all localizations and putting them back in at the end of the project, but this doesn't seem efficient to do either.
1 - Is there a way to disable localizations without deleting them in the project?
2 - Is there a way to remove localizations and then drop them back into the project at a later date efficiently? (When I say efficiently I mean easily such as drag and drop as opposed to adding them back in via multiple menus and dialogue boxes.)
3 - Any suggestions as to what might be going on here with this unique Xcode behavior?
Thanks.
2 -
delete the files by reference, and add them later (File>Add Files)
3 - When storyboards contains so many things, it will take time to load. Its good practice to use multiple storyboards which contains specific modules. So it will be readable and will load faster.
This might also help:
If you use ios8 and above you can use storyboard references
just watch out for ios8 limitation
To improve loading or reduce loading frequently, select your storyboard, press Edit, and deselect Automatically Refresh Views
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.
I have a single view App. very basic not much going on right now besides networking code.
Earlier in the day I committed changes to the main view (added buttons, text fields, styling). I did this by copy+paste -ing from an old project. Everything worked as I expected.
Now, I am on a different machine and pulled the changes in. The App is building with the "old" view (just a single button). Why is it not showing the changes that I made, and were working, earlier?
EDIT: its not just the view that isnt updating. Its running all of the old code from my previous commit. Again, the problem is that I have all up to date files.
this is a Swift app, if it matters.
Deleting the build folder in my project directory fixed my problem.
It sounds like your changes didn't get committed/pushed for some reason. Maybe the XIB/storyboard isn't under source control.
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!
(ノಠ益ಠ)ノ彡┻━┻