2

I have some set-up code in viewDidLoad that is successfully being called. The only problem is that whenever I place a NSLog(@"random") or a breakpoint in viewDidLoad, nothing is logged and execution never halts. Here's what I have tried so far to fix it:

  1. Restart Xcode
  2. Restart my computer
  3. Delete the app from my iPhone and rebuild
  4. Clean
  5. Verify my build configuration is "Debug"
  6. Done everything mentioned here
  7. Tried placing a breakpoint in applicationDidFinishLaunching: and that isn't called either.
  8. Verified that there is no #define NSLog()

If this is relevant at all, this file is Objective-C++. However, breakpoints and logging were working earlier, so I doubt that's the issue.

Community
  • 1
  • 1
pasawaya
  • 11,515
  • 7
  • 53
  • 92
  • So breakpoints aren't working at all? It's not just a problem with this one `viewDidLoad` method? If so, you should update your title - it's misleading. – rmaddy Aug 26 '15 at 14:27
  • @rmaddy - You're right. It's a project-wide problem. I'll update it. – pasawaya Aug 26 '15 at 14:29

2 Answers2

0

Check for the debug and release flag in project settings.

Rohit Kumar
  • 877
  • 6
  • 20
  • 2
    What? Of course breakpoints work on real devices. Or did you mean under specific circumstances? – rmaddy Aug 26 '15 at 14:26
  • No I didn't mean that...If you sure then I'm editing my answer until I check again. – Rohit Kumar Aug 26 '15 at 14:28
  • I did check. The build active architecture is set to debug. – pasawaya Aug 26 '15 at 14:28
  • I'm sure since I've been debugging iOS apps on real devices for the last 7 years (including today). Breakpoints work on real devices. – rmaddy Aug 26 '15 at 14:30
  • I've been testing this project on a real device for the entirety of its duration and the breakpoints have always worked up until today, so I doubt it has anything to do with real device vs. simulator. – pasawaya Aug 26 '15 at 14:30
  • try creating another project and check there if something is bad with your project settings. – Rohit Kumar Aug 26 '15 at 14:31
  • I tried once again but the breakpoints don't work for me in real devices. You can try cleaning your Xcode or reset your Xcode. – Rohit Kumar Aug 26 '15 at 14:44
  • May be I need to find out that how it works then..Will do surely. – Rohit Kumar Aug 26 '15 at 14:50
0

On a whim I downloaded the Xcode 7.6 beta, and the breakpoints seem to work again now both in the beta and in the older Xcode I was using.

pasawaya
  • 11,515
  • 7
  • 53
  • 92