ios 如何在 Xcode 中找到行号?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9769918/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How can I find a line number in Xcode?
提问by Voloda2
I have a function in my *.m file
我有一个函数在我的* .m文件
- (void)myFunction {}
How can I find the line number this function?
我怎样才能找到这个函数的行号?
回答by Simon Whitaker
You can go to:
你可以去:
Xcode > Preferences > Text Editing
then tick "Line numbers". Go to your method and you'll see the appropriate line number shown in the left-hand border of the text editor.
然后勾选“行号”。转到您的方法,您将在文本编辑器的左侧边框中看到相应的行号。
回答by neilvillareal
Go to Xcode Preferences > Text Editing > Show: Line numbers to show the line numbers on the editor.
转到 Xcode Preferences > Text Editing > Show: Line numbers 以在编辑器上显示行号。
回答by Luffy
This can also be done through code when your implementation file grows. I have found this very useful to track and debug through tedious code. NSLog(@"\nFunction: %s\t\tLine: %d\n\n",func, LINE);
这也可以在您的实现文件增长时通过代码完成。我发现这对于通过乏味的代码进行跟踪和调试非常有用。NSLog(@"\n函数: %s\t\tLine: %d\n\n", func, LINE);
For example, in some class called MyClass:
例如,在一些类称为MyClass的:
- (void) someFunction {
NSLog(@"\nFunction: %s\tLine: %d\n\n",__func__, __LINE__);
}
==== Output ===
==== 输出 ===
Function: -[myClass someFunction] Line: 175
回答by Adam Freeman
If you type command L and enter the desired line number, then you can jump to the line number in Xcode 5.
如果键入 command L 并输入所需的行号,则可以跳转到 Xcode 5 中的行号。
回答by jacinth
In Xcode 7
在 Xcode 7 中
Xcode > Preferences > Text Editing
check the Line numbers
Xcode > Preferences > Text Editing
检查行号
回答by mouness2020
Still applies in Xcode 8
仍然适用于 Xcode 8
Xcode > Preferences > Text Editing
Xcode > 首选项 > 文本编辑
回答by MRizwan33
Keep Xcode top on Mac-Screen than press "command" and "comma key btn" a xcode preferences popbox will open given below:than click on "Text Editing" menu below given window will open
here you on top written "show" with "Line numbers" just check it and thats it.
将 Xcode 保持在 Mac 屏幕上的顶部,而不是按“命令”和“逗号键 btn”,一个 xcode 首选项弹出框将在下面打开:然后单击给定窗口下方的“文本编辑”菜单将
在此处打开您在上面用“显示”写的“显示”行号”只需检查它就可以了。
Happy Coding!!!
编码快乐!!!
回答by Illya Krit
Shortcut cmd+L
. Enter line number.
捷径cmd+L
。输入行号。
or
或者
cmd+O
. $CLASS_NAME:$LINE_NUMBER.
cmd+O
. $CLASS_NAME:$LINE_NUMBER。
And your XCode goes to the line and highlights it!
你的 XCode 转到该行并突出显示它!