How to find print () or NSLog () output source in Xcode

I am not sure if this is possible. Here is an example of a situation:

Something prints to my console, and I don’t know where it comes from in the code. I did a quick search using Finder in Xcode on terms such as "NSLog" and "print". Nothing significant has happened.

Is there any quick way Xcode detects where the source code for output comes from?

Like it when you right-click on a method, and you have all the possibilities to study the various parts of the code associated with this method.

Also: are there any other features that print besides NSLog and print?

Many thanks!

+7
xcode
source share
2 answers

Try running in a debugger with breakpoints set to printf, NSLog, etc. When you hit a breakpoint, do a backtrace ( bt ) to see where it is called from

+9
source share

There is a LinkedLog plugin. You replace all LLog with LLog , and then you can simply click the link in the Xcode console to go to the line that caused it to appear.

enter image description here

I have not tried it myself, but it definitely will.

0
source share

All Articles