debugging crash errors on app launch - iphone

I am getting the following crash when I run the app on my device, but it works fine on the simulator:
Any idea of where I should probably start looking? This is super abstract to me
Also it seems that every time I run the app, I am getting a different error.
Here's a bigger image link

It might be because of zombie. Put the exception breakpoint in xcode and analyse.
In case if you don't know how to put exception breakpoint follow below steps:
Press cmd + 6 to open breakpoint navigator
Tap on "+" put present at the bottom left of the screen and select "Add Exception Breakpoint..."
Press Done.
Now run the program.
The program stops at the point where the exception is thrown. Analyse the problem and fix it.

Related

How i get my line of code instead of background process while in break status swift

Debugging is making me crazy, because my XCode Debugging is referring background process instead of my exact line of code
I don't know what happen to my xcode, anyone can help me?
Try adding an exception breakpoint.
That will stop debugging on the exact line of code which is causing problem.
1) Click on the Show the breakpoint Navigator
2) Click on the plus button at the bottom left corner
3) Select Exception Breakpoint
4) One popup will appear
5) Tap outside that dialog box
6) You can select Exception option from the dropdown if needed.
7) Make sure breakpoint is enabled when you run your application
8) Run your application
It's done by clear caching
type on terminal
defaults delete com.apple.dt.Xcode

App works on simulator but not on device

I have an app that is using the open source PSStackedView to implement a twitter-like interface. The app is working great on simulator, but when I run it on the device, as soon as I try to add a view controller to the stack the app crashes and highlights viewController.view.height = [self screenHeight]; that line as Thread 1: breakpoint 1.1
The app then just hangs on the device. I have tried debugging with zombies enabled, but it shows nothing problematic.
I am sick over this because I just finally got things going on the device, I have poured so much time into this app! Any advice would be greatly appreciated.
Your app isn't hanging - it's just hitting a breakpoint at that line, which most likely you set by accident. Go to the line where your code stops, and press Cmd + \ to disable the breakpoint. You can also press Ctrl+Cmd+Y to continue running the app past the breakpoint. There are other hotkeys and commands you can try under Xcode's Debug menu.

Getting crash location in iOS

I am getting a crash in my application which I am not able to trace out. In the log I am getting :
[CFString release]: message sent to deallocated instance 0xeb8a560
Even on debugging I could not trace out the crash. I placed breakpoints and enabled NSZombie but still not helpful. Does anyone have some idea for getting the location of crash?
for getting the exact location of crash, you need to add 'Exception BreakPoint' , that will add breakpoint to exact location where the crash occurs.
In the left side column of xcode 4:
tap on the breakpoint tab (the 6th tab over)
tap on the + button in the bottom left of the window
tap 'add exception breakpoint'
tap 'done' on the popup
reference "Run > Stop on Objective-C exception" in Xcode 4?
A string object over released. You can create an exception break point to find where it crashes. Also you can try using bt in GDB to get crash log.
This link lots of tricks and tips.
This type of error (using class retain/release memory management) can also be debugged using the Zombies Instrument. Often (not always) you can see the history of where the deallocated object was retained/released and figure out why is vanished out from under you.

How to know why application crashes in simulator

I'm running my application on the simulator but as soon as it starts it just closes I guess it crashes, however I dont get any error message or reason why it's crashing, I'm running it as debug also, is there anyplace or anyway to get an error message?
Try switching to "debugger" view, and look at the console from gdb, if it crashes you will see the error, and hopefuly the call stack.
Example of crash message: EXC_BAD_ACCESS.
If you don't have the call stack visible, you can try to type 'bt' (for back trace) at the gdb prompt.
A lot of times when my application randomly crashes before launching, there is a problem in an interface builder file (such as a connection to a now non-existant object). Check your interface builder files to see any potential bad connections or errors and if you can't find any, put an NSLog in your applicationDidFinishLaunching method to see if the application is actually being started before it crashes.
In Xcode, choose Run menu, then choose Debug — Breakpoints On. Xcode should now point you to the location in code where your app crashes in the Debugger view.

How to figure out what caused runtime error on IPhone App?

In Xcode, say you write an app for the iphone and it has a runtime
error in it. What I've been seeing is that it just closes out the
program in the simulator but doesn't really hilight or give me any
feedback as to what line caused the crash... am I missing something??
Note: I don't consider the console to be very effective since
it just spits out an error, but I still need to find where in
the heck that bug is stemming from in the code.
In the console, above the stack trace, it should say something like "[ClassName selectorName] unrecognized selector sent to instance".
Make sure you really meant to send that selector to that class. If you post what it is, we might be able to help more.
To access GDB, enable breakpoints, add one to your code by clicking in the line number gutter, press build and debug and finally open the debugger (CMD+Shift+Y).
Look in the console (command-shift-R).
You can set a global breakpoint on exceptions, which will let you trace the exact point at which they occurred. To do so, select the Run | Show | Breakpoints menu item in Xcode to bring up the breakpoints dialog. Select Global Breakpoints (so that this will be enabled for all of your projects) and create a breakpoint on objc_exception_throw in libobjc.A.dylib.
Now if you start your application by choosing Run | Debug - Breakpoints On, or manually enable breakpoints in the debugger window (Run | Debugger) before running, the application should halt at the point where the exception is thrown. You can then look at the stack trace in the debugger window, where it will highlight the particular line that caused the exception.