XCode still indicates a build is running when it isn't - ios

I'm not sure if I phrased the question properly but I'm getting strange XCode build and run behavior that is frankly too annoying to ignore anymore.
Here's my scenario:
I build and run my XCode project onto my iPhone to play around with. Then I click the square stop button in the toolbar which terminates the app on my device and the stop button turns light grey again. This is then what I see:
I edit some code and then hit play again. Hmm, that's weird, it's not building. Taking a look at the above screenshot I see that even though it looks like it stopped running it still says "running" in the activity viewer. Expanding the little "2" button shows me this:
So that's the problem. I don't know why when I hit stop, everything stops as normal but it still says "running" and isn't starting up again when I hit run again. Now here is the annoying solution I'm working with. To get it running again, first I expand the scheme menu and choose a random simulator device like so:
Then, I simply switch it back to my device like so:
After I do that, the activity viewer automatically starts building the project and launching it on my device as if everything was normal:
It does this almost every time I build and run. It didn't used to do this at all and frankly my patience has run out with it. Am I missing something? How does one solve this without my hack-around? F.Y.I. I'm using XCode 7.1 (7B91b).

I was facing the same issue, i just build the project once when the running condition is showing up and thats it it solves my issue. So i would suggest just ⌘B once.

Related

Xcode unresponsive because of IBDesignablesAgentCocoaTouch when exiting Storyboard

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?

Xcode - How come sometimes definitions are in white and sometimes colored?

When I want to view a definition on Xcode, I would use Control + Command + Click to jump to a definition. However, sometimes the syntax will be colored, sometimes it'll be all in white. Does anyone know why that happens sometimes and how to fix it?
Here's an image of how it's supposed to look. I'm trying to recreate it where it'll show all white, but I have no clue how that happens or how to fix it when it happens other than waiting.
Why this happens or is this just a bug with Xcode?
It happens sometimes when Xcode is running the App, or indexing, or doing something else.
Just wait a little while it finish processing its current task.
By the way, you can change some Navigation options in this tab :

Xamarin.Forms labels not working anymore, on iOS

I am making a Xamarin.Forms project, and I am in the end of my app, but something really strange have happened. My app starts up with no labels (!?), meaning they are invisible or not created at all. Everything else seems to be working, until I press a button that is supposed to change the label - when I do this, the app freezes. I get no exception in Visual Studio, though.
One problem is that my breakpoints in PLC code never hits, only those I place in the iOS code. However, the buttons not related to changing a label works, so I know the PLC code have been ran. If I let the app run for a little while, and then press the pause-button in VS debugging to see where in the code I am, it stops at
UIApplication.Main(args, null, "AppDelegate");
.. in Main.cs. I dont know if this is correct or not, when I run on Android, I get a Break Mode - No code is currently running.
I have been trying for hours to debug, reinstall, restart, clean and rebuild, but nothing seems to help. My code works perfectly in Android, and it worked in iOS 1 week ago. Anyone have any ideas what is going on, or what I can do to debug some more? Or must I make a new project and try start over?
Edit: I have also tried different starting pages, and all are the same: all views loads except those with text in them. I have a page with an Editor in it, and I can write in it, but no text is appearing inside of it. Only button have visible text. I do not use a custom font for my labels, I have not specified anything.
Waking up fresh in the morning, I found my issue in 15 minutes..
After altering my Google search to TextView iOS instead of Label Xamarin, I found much more answers. Thanks to this question and answer.
Basically, changing anything on the labels in the constructor of the page (even after InitializeComponent()), will mess up the view. I moved my code outside of the constructor (in the protected override void OnAppearing() method), and now it is working again.
The freeze part was not related - this was my custom menu that covered my screen with an invisible layout eating up all clicking events. A bit confusing, none of these issues are present in Android, but there you go.

Blank white screen every time I run the iOS simulator

I've created a simple program where a person can log in with a username and password. Every time I attempt to run it, I simply get a blank white screen. I tried changing the background color to a dark green one in hope that it would change it in the simulator too, however I get the same white screen.
This problem arose before I got that breakpoint error, it first started happening randomly in a previous project, which makes me think something is wrong with my xcode.
See my screenshot below:
I had this same issue where I saw the app briefly, and then it went to solid white. It pays to make sure you edit the "Main" storyboard, not the "LaunchScreen" storyboard when following tutorials...
Maybe my embarrassing mistake will help someone else...
There are a few things to keep in mind here that could be causing thsi error. Firstly, as some of the comments have pointed out the first thing you should do is delete the breakpoints from all the lines. To do that, you have 3 choices:
Press the blue arrow just above the console, that you can see here:This will disable all your breakpoints, so if you are using them intentionally somewhere else, don't use this method.
You can press each breakpoint individually, simply pressing the arrows next to your code on the left-hand side. This will disable the specific breakpoint. They then will become more greyish, like the one below #IBAction func loginTapped()
Last but not least, in my opinion the best method, simply grab the blue arrow and drag it to the right or left. This will make a cloud and zishing noise, symbolizing the deletion of the breakpoint.
Once this is out of the way, let's take the second most important step. Check that the loginViewController is the initial View Controller, so that it's the first page that's displayed. To do that, simply open the file inspector on the right-hand side. You can activate it by pressing the third button here:
Then, select your viewController,, so that it light up's blue like seen below:
Then, on the 3rd tab of The file inspector, by pressing the 4th tab that looks like an arrow pointing down. Now you should see a checkbox saying "isInitialViewController". Tick that so that you get through immediately to this screen. It should look like this down below:
Lastly, I'd like to point you to some more things you should check that could cause this error:
You never actually create the UITextField and UIButton
You have a different view covering your viewController(eg, webView or view)
You are on the wrong storyboard, this could happen but is unlikely.
If all this fails, try restarting Xcode, the simulator and running again by pressing the Play Sign or CMD-R.
Hope that helps, Julian
I don't know who this might help but I solved my problem by reinstalling CocoaPods and installing everything with pod install and pod update. I reset my mac some time back because it's storage was full and I forgot CocoaPods and all the pods uninstalled. Reinstalled them and now I'm back.
Edit:
It didn't fix it but I am getting closer.
It happened to me after exiting Xcode and closing the simulator the simulator device setting changed to the default ipod, when I realized this I changed it back to iPhone11. I got the white background but after waiting a few minutes it just worked.

Launch Screen takes too long to disappear

I just started learning Swift. It's been only a month, and I can assure you that I'm not doing anything fancy. Yet, the launch screen on the simulator is taking a long time to disappear before the app starts. It stays on for at least 5 seconds, and it takes another 2.5 seconds to slowly fade away. And as it fades out, the first view of the app slowly fades in. It was working fine (took only a fraction of a second) until a couple of days ago when this started happening suddenly while I was working on a sample app. Here are things I've confirmed:
During the initial 5 seconds, the app won't accept any user interaction. But during the 2.5 seconds of fading, it responds to touches.
This is a systematic problem because ALL sample code shows the same problem.
Even a new project, without any modifications, shows the same problem. I tried both "Game" and "Single View Application". After the name of the project is displayed as a launch screen, it takes about 8 seconds for the "Hello World" to appear completely. (When "Game" is selected.)
Restarting Xcode and rebooting the Mac do not help.
Updating to Xcode (6.4) does not help. My Xcode was 6.3.x (I believe it was 6.3.2 before the update).
Reinstalling a new copy does not help. I deleted the newly updated 6.4, and re-installed a new copy of 6.4.
The only similar incident I could find was this link, which did not provide the answer.
I was working on a simple practice program. It ran successfully just like it did numerous times before. Then, I made some minor changes to the code (nothing fancy --- just some trivial changes.) And the next time I pressed the RUN button, I noticed that the launch screen took a considerably longer to disappear. After that, it just won't go back to the way it was.
Could someone please advise the cause of the problem and the solution? Thank you very much.
You may have Slow Animations turned on. Go to the simulation and check under Debug:

Resources