Where do I find the line number in the Xcode editor?

In Xcode 3, the line number of the current cursor location was displayed. I don't see this in Xcode 4. Is there a setting that will turn it on? Or a keypress that will give it to me?



answered 7 years ago wasabi #1

In Preferences->Text Editing-> Show: Line numbers you can enable the line numbers on the left hand side of the file.

answered 7 years ago Nick Weaver #2

For Xcode 4 and higher, open the preferences (command+,) and check "Show: Line numbers" in the "Text Editing" section.

Xcode 9 enter image description here

XCode 8 and below Xcode Text Editing Preferences screen capture with Text Editing and Line Numbers highlighted

answered 7 years ago Roger #3

Sure, XCode->Preferences and turn on Show line numbers.

answered 4 years ago C_compnay #4

1) go to xcode preference by clicking on xcode on left hand side uper corner.

2) then select Text Editing

3) then select Show: Line numbers and click on check box for enable it.

4) close it.

5) you will see the line number in xcode.

answered 3 months ago Pierz #5

If you don't want line numbers shown all the time another way to find the line number of a piece of code is to just click in the left-most margin and create a breakpoint (a small blue arrow appears) then go to the breakpoint navigator (7) where it will list the breakpoint with its line number. You can delete the breakpoint by right clicking on it.

comments powered by Disqus