For quite some time now, the Xcode project for our iOS App has been making problems when viewing the "Main" storyboard.
Whenever we enter the "Main" storyboard, it builds the views like it should and lets us work on the layout. However when we then try to exit that storyboard and try to display any other file in Xcode (no matter the file type), Xcode becomes unresponsive. Looking into the "Activity Monitor" app on our Mac, it displays the following process:
Manually stopping that process makes Xcode responsive again. Now the following is displayed in the Issue Navigator:
The ViewControllers it mentions are completely white, but the project becomes usable again and building and running our app results in the correct interface being displayed.
I've looked into similar questions but can't seem to find someone with this exact problem. This IB Designable Error question doesn't seem to apply, since our project stops responding upon exiting the storyboard and doesn't just automatically throw a non-blocking error.
The accepted answer for this question also doesn't help us, since there are no actual crash logs left behind - the process doesn't crash, it hangs and needs to be manually stopped. There are no crash reports generated in the mentioned folder.
Our app currently has three storyboards, but this only happens with the "Main" storyboard, so the error might relate to a certain element in that file. We are using several IBDesignable Elements, however all of them import either none or both init statements, as described in this question.
Is there any way to look into what makes the IBDesignablesAgentCocoaTouch process use this much CPU and ultimately makes Xcode unresponsive?
Related
I released an app today which I thought I had tested vigorously. A friend brought to my attention that the tab bar controller, a crucial part of the app, simply did not work, as though user interaction were disabled. Tapping other tabs did not reveal the view controller for that tab. The tab bar item icons didn't even change, like they're supposed to when selected. They were simply stuck on the first view controller.
The weirdest part is when I took both my friend's iPhone and mine (hers a 5S, mine a 5C) and then redownloaded the app on both devices. The bug persisted on hers, but the tab bar worked completely normally on mine. Other people have complained about the same bug, but I cannot replicate it on my own phone. I could not even replicate it in several versions of Xcode Simulator. I had never seen it before.
I have already submitted a new build in which I had to force the tab bar controller to display the appropriate tab under the didSelect method, but my app will essentially be broken until the Review Board accepts it.
What could have caused this?
EDIT: The newly uploaded build still isn't working properly. Even innocuous changes aren't taking effect. I've downloaded the new version on both phones - mine shows the new navigation bar button in the top right, but the other phone still has the old button. And they are both running the same version.
It's likely the bug is related to code that is compiled differently between debug and release modes due to different optimizer settings.
There are two main categories:
Use of uninitialized variables: The value of the uninitialized variable is technically undefined, but in the debug builds it can be pretty "stable" (e.g. always equaling zero due to the variable's location in memory and what was in that location before). When you compile in Release and the location of the variable changes, or the order of initialization changes, your variable now has a different value and the code behavior changes.
Luckily for this class of bugs Xcode can help. Select "Analyze" from the "Product" menu and pay close attention to all the errors marked in blue.
Timing bugs: Typically code in Release runs faster so if you are doing anything async/multi-threaded, you may trigger timing related bugs in Release that weren't evident in Debug. I'm not sure if this is relevant for your case, though I can imagine some scenarios where a timing bug could cause views to get messed up internal state. It's hard to say without seeing your code.
Please note that changing architectures (5S is 64 bit and 5C is 32 bit) is also a factor in both of the above categories.
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'm experiencing a weird issue with my Swift 2.0 app.
I have a (editable) UITextView defined in my storyboard.
If I leave the text property empty in the storyboard everything is working as expected. But when I enter the text Kaasje (in the storyboard and recompiling), the app freezes when loading the nib (navigating through segue) and the CPU jumps to 100% (the app remains stuck).
The app will never reach viewDidLoad at this point.
It makes no difference when changing between fonts or fontsizes, behavior remains.
Pausing in Xcode does not leave me with anything useful, the main thread is busy without specifying any function. Nothing is logged to output nor any logs are created.
I'm running iOS9 on a iPad Air, the app has a built target of iOS8 and runs landscape-only.
Has anyone ever experienced anything like this before, and might have an explanation for this behaviour?
As far as my assumptions: Something goes wrong when calculating the text-size which results in a infinite loop while either calculating the size or adjusting the frame.
P.S. It happens with other texts too, but "Kaasje" always fails. It seems to fail when the the text is only 1 line. Longer texts tend to succeed aswel as leaving it empty.
As suggested in the comments there seems to be a bug in Xcode 7 in combination with iOS9.
I ended up recreating the entire view, the problem did not occur 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!
(ノಠ益ಠ)ノ彡┻━┻
I have an application that loads images into a UITableViewController, (Wine Labels), then you can navigate to the Item Details. On this page you can see a larger image of the Wine Label...IOS 6.1...
The app works for a short amount of time, then just CRASHES, not on ANY given line. The app just shuts down and I don't see ANY error message anywhere. I am having difficulties finding documentation on the correct way to troubleshoot this type of shutdown. Usually, if I crash, it fails on a line and I can usually find the problem, but in this case, Xcode is just pulling out of Debug mode(but NOT shuttind down). I don't see ANY errors in the console...Where else can I look? Xcode version is 4.6.
Any advice would be great. Thanks.