DerFlickschter DerFlickschter - 4 years ago 198
Swift Question

Xcode 8 Breakpoint in file not working

I have one file,

, in my Xcode project that out of nowhere has begun not stopping on breakpoints. I have a breakpoint in
and a few in
. I have several
calls in both functions to make sure they are executing. Breakpoints work fine in other files including

There was a point when I trying to figure out what was wrong where I noticed that while I was building the project an error would appear saying
Invalid redeclaration of 'signInViewController.swift'
and then go away before the build finished and the app would run fine, except for the breakpoints in the file.
is the old name of the file from months ago before I renamed it to
. I haven't seen it before until the breakpoint issue occurred and since I have cleaned the project's build folder and Xcode's derived data I have been unable to replicate. I have a feeling that it is factoring into the problem but I am not sure how/why.

Anyways, here is things I've tried already. Most of them are just for breakpoints not working in general but I figure I should list them anyways even though that is not the case:

  1. Clean Project

  2. Clean Build Folder

  3. Clear Xcode's DerivedData

  4. Making sure breakpoints are enabled (Cmd Y)

  5. Build Settings are set to Debug

  6. Always Show Disassembly enabled and disabled

  7. Debugging enabled in run config

Any help would be very much appreciated.

UPDATE 1 (still no luck):

  1. Tried deleting the Xcode preference as suggested by neprocker's answer here


I have isolated the breakpoint issue to just
breakpoints elsewhere in the file are working.


Isolated to a specific block of code in
still not working though.

Answer Source

I'm not really sure how this ended up fixing it but I isolated the issue to a specific block of code in viewDidLoad(). Then I commented out that code and built and ran the project. Then I uncommented the code and built and ran it again and the breakpoints worked.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download