How to find line number in Xcode?

I have a function in my * .m file

-(void) myFunction {} 

How can I find the line number of this function?

+64
ios xcode xcode4
Mar 19 '12 at 12:10
source share
7 answers

You can go to:

 Xcode > Preferences > Text Editing 

then check "Line Numbers". Go to your method and you will see the corresponding line number indicated on the left side of the text editor.

+166
Mar 19 '12 at 12:13
source share

Go to Xcode Settings> Text Editing> Show: Line Numbers to display line numbers in the editor.

+5
Mar 19 '12 at 12:16
source share

This can also be done with code when your implementation file grows. I found this very useful for tracking and debugging through tedious code. NSLog (@ "\ nFunction:% s \ t \ tLine:% d \ n \ n", func , LINE );

For example, in some class MyClass:

 - (void) someFunction { NSLog(@"\nFunction: %s\tLine: %d\n\n",__func__, __LINE__); } 

==== Conclusion ===

 Function: -[myClass someFunction] Line: 175 
+4
Apr 09 '13 at 7:21
source share

If you type the L command and enter the line number you need, you can go to the line number in Xcode 5.

+3
Jul 22 '14 at 17:16
source share

In xcode 7

Xcode> Settings> Text Editing
check line numbers

+3
Oct 06 '15 at 6:01
source share

Still applied in Xcode 8

Xcode> Settings> Text Editing

+1
Sep 10 '16 at 2:00
source share

Hold Xcode on top of the Mac-screen, then press "command" and "comma key btn", the xcode settings panel pox will open, indicated below: enter image description here than clicking on the "Text Editing" menu will open under a given window enter image description here here you wrote β€œshow” with β€œline numbers” on top, just check it and that.

Happy coding !!!

0
Aug 09 '17 at 5:45 on
source share



All Articles