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?
553
votes
6 Answers
991
votes
42
votes
5
votes
1
votes
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.
0
votes
To save $4.99 for a one time use and no dealing with HomeBrew and no counting empty lines.
- Open Terminal
- cd to your Xcode project
- Execute the following when inside your target project:
find . -name "*.swift" -print0 | xargs -0 wc -l
If you want to exclude pods:
find . -path ./Pods -prune -o -name "*.swift" -print0 ! -name "/Pods" | xargs -0 wc -l
If your project has objective c and swift:
find . -type d \( -path ./Pods -o -path ./Vendor \) -prune -o \( -iname \*.m -o -iname \*.mm -o -iname \*.h -o -iname \*.swift \) -print0 | xargs -0 wc -l