It is not entirely clear how much you know, therefore I am going to try a very simple approach, please do not be offended.
I assume that NSTextView is in external nib / xib and is not created programmatically.
If so, open your nib / xib in the interface builder and click on the offensive NSTextView element.
Then click Cmd-5 or Tools-> Connection Inspector
Here you can see which Outlets / Actions to look for in the source code.
Most likely, you are the problem - this is the manipulation of the Reference output object or the function Sent action .
Once you have an idea of ββwhich method (s) / variable you need to look at, you can open the source code for these parts in Xcode. Then you can set a breakpoint on any line by clicking on this line number on the left side of the editor window.
Click Run β Debugger . A new window will appear, click " Run and Go " on the toolbar of this window. Your application should work as usual until it reaches the breakpoint set by you in the source code. when you hit the break point, you can drag and drop variables into your code in the lower half of the debugger window. The current values ββof the variables should pop up, making it easy to check.
You can usually get the same information using the Top Right panel of the debugger to check the variable table.
When you are done with this breakpoint, click Continue at the top of the debugger window and your program will execute until the end or the next breakpoint.
This should start with debugging in Xcode. Their different kinds / uses of breakpoints and all sorts of extra fancy things you can do in Xcode. Check out this awesome CocoaHeads video for more information.
Luck,
Brian G.
source share