Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

nslog stopped working in xcode

I have a strange issue and possibly a bug. My NSLog statements have stopped working completely, they do not print even in view did load, application didfinishlaunching etc. The have all turned a brown colour (the same colour as a pragma mark in xcode) and they all have a warning saying 'expression result unused'. Has anyone ever seen this before or know what to do? Am i running in some kind of weird mode? Im running xcode 4.0.2.

Many thanks

Jules

like image 964
Jules Avatar asked Jun 08 '11 13:06

Jules


3 Answers

for completeness, I had the same problem and the answer was different, hope it helps someone else who bumps into this post:

I had a framework (an Amazon one) redefining NSLog, went there (Cmd+Click on the Brown NSLog) and commented out the redefinition...

like image 76
xfze Avatar answered Oct 06 '22 00:10

xfze


The actual problem was the release_build set to 1. So it wasn't recognizing nslog, as you said it was set for a release build.

like image 26
Jules Avatar answered Oct 05 '22 23:10

Jules


I had the same issue :

what worked for me is given below:

  • Remove the derived data folder
  • After removing derived data perform the clean action (You can see this option in the product menu)

  • Quit the Xcode and start it again.

And this did the trick all my NSLog were working fine.

Hoep this helps

like image 24
Radix Avatar answered Oct 06 '22 01:10

Radix