2

I have breakpoints set throughout my program, but Xcode appears to ignore them completely.

I wanted to create a new question, because this one was asked in 2008 and has nothing up-to-date.

Lemon
  • 1,184
  • 11
  • 33
  • 1
    The issue is something on your end. Breakpoints work for me. I think your best bet is to (a) delete all breakpoints, then (b) set a breakpoint in - for a UIKit project - in something like viewDidLoad. If you *still* aren't hitting it properly, set up more details so maybe someone here can duplicate things. As of now, it's impossible to do that with the lack of details in your question. –  Nov 20 '20 at 23:59
  • Tried all of the above. I just don't know how to duplicate anything because there are so many parameters and everything to go over. It also wouldn't be the best to upload the entire project. – Lemon Nov 21 '20 at 04:03
  • Never said you should upload the entire project. Just take baby steps. Since breakpoints in 12.2 work for me like they always have, start there. new project, totally blank. Set a breakpoint. If it works, then it's **not** Xcode 12.2 as your question claims. And yes - now the hard part starts. Because it's obviously *something* in your Xcode project. Could be anything.... a third party plugin, a corrupt project, even a corrupt Xcode download (or worse, the hardware you are using. Start simple and acknowledge that the issue isn't Xcode (trust me on that - I actually did create a blank project.) –  Nov 21 '20 at 05:12
  • @dfd Yeah I know :) I seemed to have fixed the stuff in the main project, I don't actually know how though. Only problem now is it only works in the main project and no extensions, for example the widget extension or the intent one. Is there a way to fix them? – Lemon Nov 21 '20 at 06:59
  • Turns out you have to attach the debugger to your extension using Debug > Attach to process PID or name > type the name of your extension. In my case "WidgetIntent" – Lemon Nov 21 '20 at 10:01
  • @Lemon please add your solution as an Answer. – pkamb Feb 21 '21 at 19:28
  • @pkamb I don’t think that’s a good idea because the comment there has nothing to do with the question I asked. – Lemon Feb 21 '21 at 19:29
  • Wasn't the problem caused by an Extension not hitting its breakpoints? – pkamb Feb 21 '21 at 19:33
  • @pkamb Read the rest of the comment thread. – Lemon Feb 21 '21 at 19:34

2 Answers2

1

Perhaps you've accidentally turned off the master breakpoint switch.

enter image description here

It should be bright blue, not gray. Click it to toggle.

mr. fixit
  • 1,404
  • 11
  • 19
  • 2
    Unfortunately this wouldn't be the solution as it's been enabled the whole time :(.. Also also note, I have my system colour thingy set to 'green' - so it's actually bright green for me. – Lemon Nov 21 '20 at 04:26
0

This happened to me for a very odd reason. I added rich notifications to my app. As I ran the app I was running it on one of their targets instead of the main app itself. The orange arrow points to the main target. In a situation like this make sure you aren't on the wrong target (the ones above and below the orange arrow.

enter image description here

Lance Samaria
  • 17,576
  • 18
  • 108
  • 256