My application is crashing after play with it 10 min.
And in console nothing is show about this crash and no waring, no logs.
And I am not getting any memory warning.
Please help me.
See Next to stop button your project name will be there click there and go to edit Scheme -> Argument -> Environment Variables -> click on + button and write NSZombieEnabled and then value YES.
It will tell that where exactly your app is crashing.
Try setting your Run Static Analyzer to YES then shift+Command+B. See if you have potential Memory Leaks. Or try running you code with Intruments.
or try this:
Edit Scheme
then add the NSZombieEnabled like the image below.
Try Adding breakpoints in the code to check the point where application is crashing..
Related
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.
1.When my app crashes and there's no message in console window Xcode shows me a green line with signature EXC_BAD_ACCESS or PROGRAM RECEIVED SIGNAL SIGABRT in the code editor. The question is: does Xcode always put this green line at the line of code where a bug is placed? If i see this green line put at the line
[myObject myMethod];
may i be confident that the bug should be searched for inside the myMethod function? Or maybe it may mean something else?
2.Sometimes this green line is put inside main.m file at the line
int retVal = UIApplicationMain(argc, argv, nil, nil);
Do you know what specific about placing the hint there? What does it mean?
3.Also sometimes the strangest thing happens: Xcode shows me a file with assembler code and the green line inside this code. Why? What should i understand when i see that?
4.If i repeatedly do the following: enter a screen, then do something, then quit the screen - my app crashes. It may crash at the second time or at the seventh one. What is the most common causes for such a crash? A memory leak? But Analyze tells me there are no leaks in my app. What do you think it may be?
As I said in another post :
In XCode, go to menu "edit scheme", choose the running configuration and add 'NSZombieEnabled' like in the picture below, when your apps crashes, it will provide you additional infos on the crash that should help you debug it.
Note that when your application debug is over, remove the NSZombieEnabled command as it impacts the application performances
The simple answer to point 4: The most common cause of a crash accessing deallocated/over-released memory.
You can check for NSZombies or debug any memory references that you can find in the error message.
You can find some hints here iPhone Xcode debugging
Regarding (3) I do not think there is a way to interpret that assembly code.
I'm not exactly sure how to debug this but it seems that I'm getting EXEC BAD ACCESS in the main function of my app. There's no trace or logs of what's going on. I have NSZombiesEnabled but it doesn't seem to be showing anything. How would I debug this?
The first step in debugging is to find out where the crash happens. To do this you need to be able to reproduce the bug.
The Xcode debugger will usually tell you where the crash happened. It doesn't happen in main(), that's simply the entry point for the app and the top of the call stack. You can zoom in to the call stack with the slider at the bottom of the Debugger pane (in Xcode 4).
If the stack trace doesn't include any of your own code, then you may need to set an exception breakpoint in the Breakpoints pane and try again.
If all else fails, you'll have to do some digging:
1) Find a reproducible case where you can make the app crash every time (or almost every time) using the same actions.
2) Since you know what you're doing to make the app crash, you roughly know where in the code you should look. Set breakpoints at strategic places (or use NSLog). After some fishing, you'll find the exact line where the app crashed.
3) Fix the problem. :-)
It may be helpful.
Mainly you are getting this error because you have released something which is useful in furthur.So try to focus on the release.comment the line where you have used the release
Have you tried too clean and rebuild your project, and restart XCode. Latest versions of Xcode sometimes does EXEC BAD ACCESS int the main function with no reasons…
Turns out, pushing multiple view controllers simultaneously will cause this. Hard to debug that!
I am hoping someone can help me. I have just started running xcode 4.01 and for some reason whenever I run an app, it does not stop on breakpoints or display the NSlog messages. I have a message in my viewDidLoad and it never shows. I even breakpoint on this log and the best I can get in the output window is:
pending breakpoint 1 - "universalTestAppDelegate_iPad.m:15" resolved
pending breakpoint 2 - "universalTestAppDelegate_iPhone.m:16" resolved
Actual code is:
-(void) viewDidload
{
NSLog("in viewDidLoad");
}
So it appears it sees the breakpoint but never stops on it. As I said, brand new to xcode 4 so any idea on what I am doing wrong? Uninstalled and reinstalled and still nothing. Also, if it means anything, in the Scheme to choose where to run, I can select IOS devie, iPad 43 simulator and iPhone 4.3 simulator. Tried both and still nothing. Why can't I select/see other versions of the IOS?
BTW: The above is because I do not have my iPad or iPhone connected. Thanks in advance for any and all help.
Geo...
Your method is just never called.
Make it
-(void) viewDidLoad
with big "L" and your chances of "breaking" will sky rocket. ;)
Two possibilities:
You don't have breakpoints turned on. Use the Product->Debug->Activate Breakpoints command to rectify this.
You have breakpoints turned on but you placed your breakpoints on lines that haven't been executed. If your log statement doesn't appear in the console, that would indicate that the method containing that statement isn't executing, so it's no surprise that the breakpoint on that line has no effect.
I had similar issue where the debugger would not stop on breakpoints in the simulator using Xcode 4C199. Turns out the simulator was just buggered and restarting it resolved the issue.
I also had the issue with XCode 3 where I had localized the name of the app to a set of Japanese characters. The debugger didn't like that. I solved that one by having english name for debug configuration and japanese name for release.
While debugging the program my breakpoint is not working, so please give me some advice so that it can work properly.
Maybe you've tried to use the breakpoint on unreachable code? Try setting your breakpoint somewhere before the point you want to reach and try stepping from there to see if the point is actually reached.
Possible Reasons could be.
1. After changes in the code you have not built the libraries properly so the breakpoint is not pointing to the right location in the code.
2. If you are putting a breakpoint in a library then make sure the library is build and is built in Debug mode.
3. Clean full environment and rebuild the project.
Open XCode preferences and in the Debugging tab, un-check "Load symbols lazily", this caught me out when I first started iPhone developement. Then again, it might be for any of the other reasons that people have already mentioned.