How to set the exception breakpoint in xcode 6 - ios

hi after crashing i set the exception break point by pressing break point symbol and i choose objective c language while editing the break point. I run it again ,app is crashed ,but it is not stopped where the exception is occurred in xcode6
Thanks in advance.

Ok than try using enabling zombie environment.
Follow these steps:
Click on project name and edit scheme.
A pop over will appear, In that select Arguments tab. See bottom section Environment Variables. You can see + button at bottom part. Click on that button and add varialbe NSZombieEnabled with value YES.
Now from same popover select Diagnostics tab. And mark Enable Zombie Objects.
Click close and again run your project, hope this will track down zombie objects at runtime which cause runtime crash.

See the following steps.
Look into [Navigator] and Click on [Show the Breakpoint Navigator].
See the bottom of Navigator [ + ] Sign. Click on it
Select [Add Exception Breakpoint].
Your Exception Breakpoint are activated from this things.

Related

Thread1: Breakpoint 1.4 [duplicate]

I am following the Stanford University iOS development course on iTunes U.
In one of the demos (that I have been trying to follow), there is this code that loads the property list from an NSURL and returns it as NSMutableDictionary.
-(NSMutableDictionary *) words
{
NSURL *wordsURL=[NSURL URLWithString:#"http://cs193p.stanford.edu/vocabwords.txt"];
words=[[NSMutableDictionary dictionaryWithContentsOfURL:wordsURL] retain];
return words;
}
The application is successfully built, but at runtime it gives the following error and gets stuck:
I can't figure out what the problem is. Can you please help?
You're stopped at a breakpoint. That's a debugging tool, not an error. See the blue arrow/tab in the left margin, where the line numbers are? Drag that away and drop it anywhere (you'll see a "poof") to remove it, then run your project again.
You can also deactivate all breakpoints by typing ⌘-Y, the key equivalent for the menu item Debug>Deactivate Breakpoints, or you can view all your breakpoints in the Breakpoint Navigator (hit ⌘-6).
When execution stops like this, you can continue from the breakpoint, either by typing continue at the debugger prompt in the Console:
(lldb) continue
Or hitting the "Play" button in the debugger controls. You can also type Control-⌘-Y, which is the equivalent for the menu item Debug>Continue.
This isn't an error. You just set a breakpoint (probably without knowing it).
Drag the little blue Chevron in the column at the left out of the way. You will see it disappear and go poof, and then you can rebuild your app and you should see it run properly.
Now, that said, I think there are some memory management mistakes in your code, but we can return to those later. ;-)
The program is stopping because you have a breakpoint.. That's the blue arrow on the left of the code. Right-click it and delete.

XCode App randomly crashing - message sent to deallocated instance

I am getting the following error on my app when it randomly crashes during testing.
The logs show the following:
Is there any way possible I can track why this error is apprearing? I'll be super grateful.
Best.
Go to the Breakpoint Navigator. Click the plus sign on the bottom left. Add exception breakpoint. It will break right before the weird error you are seeing :)
You know the pane on the left that shows your files? At the top of it there are 7 buttons or so, and one is shaped like a breakpoint. That's the navigator.

How to find EXC_BAD_ACCESS variable from memory address in XCode6? [screenshot included]

This EXC_BAD_ACCESS error pops up once every 5~8 runs.
I am aware that it's caused by duplicate or bad variable usages, etc.
But I can't find exactly WHERE it is causing this error from my codes.
Is there a way to find out which variable is causing such problem?
You can use Zombie to get symbolicated info related to crash
Enable Zombie Objects by-
And then, checking the Enable Zombie Objects checkbox,
Run(profile) your project in simulator -
The instruments will be launched as-
Instruments would show a message similar to the following:
Your next step should be to set an exception breakpoint in Xcode. When your app crashes, Xcode will pause your app at the point where the crash occurs. To set an exception breakpoint, open the breakpoint navigator by choosing View > Navigators > Show Breakpoint Navigator. Click the + button at the bottom of the navigator and choose Add Exception Breakpoint.

How do I delete a breakpoint marker in xcode?

So my app is 100% done, however when I compile it in xcode the app loads up normal, but when I press the button, which is the apps main function, it encounters a thread breakpoint error and I'm not sure why.
When I run the app by itself in the simulator without xcode it runs perfect, the thread error only happens when I run it in xcode.
Thanks again for any help that can be provided!
Click on that dark blue arrow next to the "Play Sound" comment, and it will turn light blue (disabled). Or right click (or option-click) on the blue arrow and you have an option to remove the breakpoint.
Or select the breakpoint navigator ("View" - "Navigators" - "Show Breakpoint Navigator") and manage your breakpoints there.
See WWDC 2012 video Debugging in Xcode.
Your app stops when running in the debugger because you have set a breakpoint at that line. Delete or disable the breakpoint. There is nothing wrong here and there is no error. The debugger is doing exactly what you told it to do.
In XCode 9 the easiest way to delete breakpoint is to just left-click and drag it.

How to track the exact issue for the crash in iOS

When I was debugging my iPhone app, I got an error and the app got crashed. I have added a exception break point but it didn't point any where in the code and crashed in main.m.
Here I am adding the screen shot of the XCode window when the app crashed.
How can I find the exact issue for the crash from this?
Is it possible? Please help.
Enable Zoombie so that you will get the error description in log.
If you edit the scheme you want to turn on zombies for (in the "Product" menu, select "Edit Scheme"), go to the "Run Foo.app" stage in the left panel, and the "Arguments" tab on the right. You can then add NSZombieEnabled to the "Environment Variables" section and set the value to YES, as you could in Xcode 3.
In Xcode 4.1 and above, there's also checkbox on the "Diagnostics" tab of the "Run" stage to "Enable Zombie Objects".
click on EditScheme in XCode. then screen will be show like below. click on Enable Zombie Objects.It will shows error on your log.
Add an Exception breakpoint and the debugger will stop on the line that crashes.
Not sure but reading the registers might help.
First go to Exceptions tab and 'Add Exception Breakpoint' using the + at the bottom left corner.
Then when the app crashes click on "0 objc_exception_throw" under Thread 1
Finally in the console enter:
register read
(you should get a list of registers)
po $rax (normally the exception is in 'rax')
(you should see the exception output on the console)
Hope this helps.

Resources