0

I am doing one application. I am developing my application in

Xcode version 4.2(4c199) with iOS 5.0(9A334) and iPhone simulator(9A334).

I have iPhone 4 with iOS 5(9A334) device also.

My problem is when I am running the application in my device, breakpoints are not fired. I was suggested to fix the build configuration to debug. But it's not useful. So please tell me how to solve this one.

Adil Soomro
  • 37,609
  • 9
  • 103
  • 153
  • Are you 100% sure your break points are not firing? Is it possible your code isn't being entered as expected? If you set a breakpoint somewhere in your appDidFinishLaunching... Method, is it fired or ignored? – Jason Coco Jan 10 '12 at 05:44
  • they are not fired at that position also. – user1138045 Jan 10 '12 at 07:10
  • If the breakpoints aren't firing, then maybe your code with the breakpoint isn't being called? By default if you create a breakpoint it will work. – sosborn Jan 10 '12 at 07:16

2 Answers2

2

We don't have a lot to go on, but here are some things you could try:

  • build and run in debug, not release.
  • try a symbolic breakpoint instead of a source location.
  • try switching to the other debugger (GDB or LLDB)
  • plop an assertion or log in. does it abort or print? (your object may be nil)
justin
  • 104,054
  • 14
  • 179
  • 226
1

Breakpoints only work when the debugger is attached, and you have to enable them in Xcode first. Look for the "Breakpoints" button in the toolbar and ensure that it is depressed.

Also, I've heard reports that the "Load symbols lazily" option can cause breakpoints not to be hit on occasion. Try turning that option off in Xcode preferences and rebuilding your project.

Cody Gray - on strike
  • 239,200
  • 50
  • 490
  • 574
  • In xcode 4.2 where we find the "Load symbols lazily" option. – user1138045 Jan 10 '12 at 05:43
  • Never mind, that option doesn't exist in Xcode 4. Turning on breakpoints using the toolbar button is the recommended course of action. Related questions: [Where is the “Load symbols lazily” debugging option in XCode4?](http://stackoverflow.com/questions/5280137/), [Xcode4 : Why my breakpoints are not working in Xcode4?](http://stackoverflow.com/questions/7171959/), [XCode automatically deactivating breakpoints](http://stackoverflow.com/questions/529071/), [Why aren't my breakpoints working in Xcode?](http://stackoverflow.com/questions/64790/) – Cody Gray - on strike Jan 10 '12 at 05:46