Xcode breakpoints not showing current objects - iphone

I've recently run into a really frustrating problem. When I set a breakpoint, and my program stops, the objects aren't shown in Xcode. I don't get the typical 'self' or any of my other objects. I tried restarting Xcode and my computer. I don't really know what else to do.
I'm running Xcode 4.6.1. Has anyone else run into this problem?

I usually get this error when I have compiler optimization turned on. The compiler will generate code which does not necessarily follow your code logic flow.
Go to your project in the navigator -> Target -> Build settings -> Search for optimization level -> expand optimization level -> select the debug line -> change to none in both columns of your project and target.
Hope this helps.

Related

Xcode6 Beta6 - Unknown class SCNView in Interface Builder file

I created a new Swift project and made a couple of changes according to this tutorial as follows:
Modified the GameViewController.swift as shown in the tutorial.
Created GameScene.swift as shown in the tutorial.
NOTE: I am not listing the source code here verbatim as I believe it has no part in this error, but I'll gladly do so if anyone thinks otherwise.
Then I should be able to just compile and run the project to load a background image. Instead, I get the following error message during compilation.
I noticed there are some variations of this kind of error on SO, and I tried the following suggestions with no success:
iOS Simulator (Menu) -> Reset Content and Settings -> Reset
Window -> Organizer -> (Select my project) Delete Derived Data
Xcode -> Preferences -> Locations -> Selected Xcode 6.0 (6A280e) for Command Line Tools
What else can I do to get past the error? More importantly, perhaps, what's causing this error in the first place?
Looks like you chose SceneKit when creating your project from the template, instead of SpriteKit as the tutorial specifies.

Compiling my App gives no errors but hangs when compiling on device

I've made an iPad App. I was able to run this App on my device and on simulator.
After I've updated several classes (which I tested in simulator) I wasn't able to run my App on my device. It gives no errors but just hangs when compiling.
I'm thinking it's something with a class which came out very large and has some mathematical functions inside (calculations of transforms etc.)
After a long runtime Xcode gives back this error (something about a 'clang error'):
Anyone has any experience with these kind of issues and could find a solution?
EDIT:
Within my viewdidload method i have set 112 float values (i.e. value = 12;) and save them (with NSUSerdefaults).
Only setting these values solved my problem. No idea why this was giving me compile errors. I'm thinking the mathematical functions (after setting the float values) took to much memory or CPU.
Did you try cleaning your build and rebuild again?
Menu > Product > Clean
close & reopen XCode, "Clean All Targets" then rebuild. It should work.
Clean your project, delete the app from you iPad and try again. Should work.
Hope it helps
Are you trying to "Build and Analyze" or an ad-hoc build or debug build?
If your code crashed because of any memory issues or bad access memory due to any infinite loop, try to enable NSZombieEnabled in your executable settings. It will point you to the code snippet where the code crashes.
To enable "NSZombieEnabled", go to
Edit Active Executables -> Arguments -> Variables in the environment -> Add name as "NSZombieEnabled" and value to "YES"
Hopes this helps.

Xcode 4 is no longer showing me where my warnings are?

Xcode 4 has stopped showing me the locations of build warnings that I have. How can i get it to start showing me them again?
Make sure you're looking in the right place. On the left-hand side of Xcode (4), look for the little error symbol. Click it and enjoy your errors in all their glory.
If you click on the errors and it doesn't take you to the location in code, I think something must be messed up with your Xcode install. I remember you had another question earlier about Xcode problems, so it wouldn't hurt to uninstall & reinstall.
In Xcode 4.3.1. I have one project that doesn't show any warnings, but others do.
So it's not an Xcode issue I guess.
In the Issue Navigator (⌘4) be sure to clear the filter at the bottom left of the screen:
Just click on the x at the right, at the filter will be removed -- worked for me!
Check the below SO post
(iphone) Is there a way to see compile output of xcode4?
press command + 4 for issue navigator. (there are two filter here "By File" and "By Type")

XCode debug vs release build when debugging

Ok, i think i've seen it all now.
For about 24 hours i've been trying to debug my app, trying to find where all the weird crashes are coming from all of a sudden. I've been debugging via Simulator/Debug mode. As usual, when i hit a breakpoint, i could see the value of variables (most of the time). Then suddenly i was unable to view variables no matter what i did (btw, im talking about mouse-hovering as for some stupid reason my xcode disabled all the debugging tools from the debug menu).
Long story short, out of sheer loss of things to do, i decide to debug with Release mode. Now I can hit breakpoints and see the contents of my variables. And whats even more confusing is that now xcode gives me a much more comprehensive view of the variables that im 'watching' (hovering over).
I know Apple likes to do things different. But what the heck!? Can somebody please slap me and then tell me what im not understanding here?
First, the configurations "Debug" and "Release" are just names, you could also name them "Jon" and "Carla" if you want. They are just names for a configuration sets that you can modify and you can tweak them so that for example the "Debug" configuration is not suitable for debugging any more. So if you (accidentially) disabled generating debug symbols in your "Debug" configuration you would get exactly what you described.
Go to "Project" -> "Edit active target". Select the "Build" tab and select the "Debug" configuration in the drop down box on the upper left. Select "Show all settings" in the drop down box below and type "debug" in the search bar right next to these two drop down boxes.
There should be a setting "Generate Debug Symbols", make sure its check box is set. "Level of Debug Symbols" should be set to "All Symbols". Also, the "Debug Information Format" should be set to "DWARF with dSYM file".
After changing the settings, clean your project ("Build" -> "Clean") and build again.
Hope that helps.

Debuging to simulator crashes with "exited with status 5" unless I have breakpoint

For some reason the app I am working on has very bad PMT! Literally! Most of the time I cannot debug using the simulator without putting a breakpoint in my AppDelegate. If I don't it exists with "status 5". If I put a break point in and simple continue it works perfectly well, it also works if I run the app in the simulator when not connected to the GDB.
I have tried the source on a second machine with exactly the same results. I dont have this issue building to the device?!?!?!
Thanks
from : http://forums.pragprog.com/forums/100/topics/2168
Sep 14, 2010 9:55am
Mark Allen
(1 post)
I had this too. Fortunately I had the project under source control, so I did
a diff and realised the project file is not the culprit. Turns out there is no
need to create new projects or anything. Just delete your personal settings files
for the project. They will be username.mode1v3 and username.pbxuser. I didn’t
figure out which file was the cause, but deleting them sorted it out.
I had same problem. Restarting X-Code didn't help.
What did help was clearing all my breakpoints.
From the X-Code menu, click Run -> Show -> Breakpoints, then, from the breakpoints screen delete all breakpoints. Shut down the simulator, then rebuild the project.
Problem solved for me.