-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Xcode 中的用户断点 #1943
Xcode 中的用户断点 #1943
Conversation
校对认领 @sqrthree |
@leviding 好的呢 🍺 |
校对认领@sqrthree |
@fengzhihao123 妥妥哒 🍻 |
TODO/user-breakpoints-in-xcode.md
Outdated
|
||
![A regular breakpoint](https://pspdfkit.com/images/blog/2017/user-breakpoints-in-xcode/regular-breakpoint@2x-a201ce1c.png) | ||
|
||
These breakpoints are stored inside the personal settings for this particular workspace or project and are visible only for you, even if you commit your personal settings to the project. Colleagues working on the same project will not see your breakpoints in their Xcode. | ||
这些断点保存在特定工作区或工程的个人设置中,仅自己可见。即使你将个人设置提交到项目中,在同一个项目中的同事的 Xcode 中也不会看到你的断点。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
在同一个项目中的同事的 Xcode 中也不会看到你的断点 -> 在同一个项目中的同事也不会在他们的 Xcode 中看到你的断点
TODO/user-breakpoints-in-xcode.md
Outdated
|
||
Everybody uses breakpoints in Xcode, but are you aware of user breakpoints? I am going to show you how to use them and what to use them for. If you already know what user breakpoints are and how to use them, check out the list at the end of the article and see what we use them for at PSPDFKit. Maybe there is something new for you to add to your list! | ||
(这里的 User Breakpoints 是译成 "个人断点" 好呢,还是 "用户断点" ?) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
感觉用户断点好一点
TODO/user-breakpoints-in-xcode.md
Outdated
|
||
- **Symbol:**`UIViewAlertForUnsatisfiableConstraints` | ||
|
||
Automatically stops on auto layout constraint issues. This brings much more attention to the issue that otherwise would just print a log message in the console inside Xcode. It helps a lot with identifying layout issues early. | ||
当出现自动布局约束的问题时自动停止。这会让我们更加关注这个问题,否则就会在 Xcode 中打印一个日志消息。它有助于及早地发现布局问题。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这会让我们更加关注这个问题,否则就会在 Xcode 中打印一个日志消息 -> 这会比仅仅在Xcode的控制台输出一条打印信息更让你注意这个问题
TODO/user-breakpoints-in-xcode.md
Outdated
|
||
- **Symbol:**`-[UIViewController initWithNibName:bundle:]` | ||
*Debugger command:*`po $arg1` | ||
|
||
Prints the class of a view controller during its initialization. When working on large projects or if you are new to a project, you do not know all the names of the view controllers. If you are trying to figure out what the name of the view controller is that you want to make changes to, just activate this breakpoint and then navigate the app to the view controller in question. You will see the name of it printed in the console. | ||
在视图控制器初试期间打印其类型。当在大型项目中工作或者你是个新来的,你会不知道所有试图控制器的名字。如果你想知道你要修改的视图控制器的名字的话,你只需激活这个断点,然后在应用中导航到这个视图控制器,你会在调试器中看到所打印的名字。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
在视图控制器初试期间打印其类型 -> 在视图控制器初始化期间打印其类型
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO/user-breakpoints-in-xcode.md
Outdated
@@ -3,80 +3,81 @@ | |||
> * 原文作者:[Michael Ochs](https://twitter.com/_mochs) | |||
> * 译文出自:[掘金翻译计划](https://github.com/xitu/gold-miner) | |||
> * 本文永久链接:[https://github.com/xitu/gold-miner/blob/master/TODO/user-breakpoints-in-xcode.md](https://github.com/xitu/gold-miner/blob/master/TODO/user-breakpoints-in-xcode.md) | |||
> * 译者: | |||
> * 译者:[oOatuo](https://github.com/) | |||
> * 校对者: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 校对者:LeviDing
TODO/user-breakpoints-in-xcode.md
Outdated
@@ -3,80 +3,81 @@ | |||
> * 原文作者:[Michael Ochs](https://twitter.com/_mochs) | |||
> * 译文出自:[掘金翻译计划](https://github.com/xitu/gold-miner) | |||
> * 本文永久链接:[https://github.com/xitu/gold-miner/blob/master/TODO/user-breakpoints-in-xcode.md](https://github.com/xitu/gold-miner/blob/master/TODO/user-breakpoints-in-xcode.md) | |||
> * 译者: | |||
> * 译者:[oOatuo](https://github.com/) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 译者:oOatuo
TODO/user-breakpoints-in-xcode.md
Outdated
|
||
## A Regular Breakpoint | ||
大家应该都用过 Xcode 中的断点,但你们熟悉用户断点么?下面我将向你们如何使用以及何时使用这种断点。如果你已经对个人断点有所了解了,可以查看下文章后面的清单,看看我们是如何在 PSPDFKit 中使用它们的,也许有一些新的东西可以添加到你的清单中! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
下面我将向你们如何使用以及何时使用这种断点。=> 下面我将向你们介绍如何使用以及何时使用这种断点。
TODO/user-breakpoints-in-xcode.md
Outdated
|
||
## A Regular Breakpoint | ||
大家应该都用过 Xcode 中的断点,但你们熟悉用户断点么?下面我将向你们如何使用以及何时使用这种断点。如果你已经对个人断点有所了解了,可以查看下文章后面的清单,看看我们是如何在 PSPDFKit 中使用它们的,也许有一些新的东西可以添加到你的清单中! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
个人断点还是用户断点?
统一一下吧
感觉用户断点好些
TODO/user-breakpoints-in-xcode.md
Outdated
|
||
Another slightly less useful thing you can do with this: add a shared breakpoint in a commonly executed code path of your app, such as the completion of a network request, make it continue automatically and let it play a sound every time it is hit – yes, you can make your breakpoints play sounds. Commit and watch your co-workers go nuts when they try to figure out where that sound is coming from! 😁 Sadly trolling your co-workers is the one thing that doesn’t quite work in a remote environment, which is why I have not done that at PSPDFKit... but that might be something to entertain for [our retreats](https://pspdfkit.com/blog/2016/the-importance-of-retreats-for-a-remote-company/). | ||
另一个你可以用它来做的稍微不那么有用的事:在应用程序的执行代码路径中添加一个共享的断点,比如完成一个网络请求,让它自动地继续运行,并让它在每次被击中时播放一个声音 - 是的,你可以让你的断点发出声音。提交断点,然后看着试图弄清楚声音是从哪里来而抓狂的同事!😁 不过,在远程工作的环境下,恶搞你的同事是很难的,这就是我为什么没有在 PSPDFKit 这么做。。。但可以在[我们的线下团建](https://pspdfkit.com/blog/2016/the-importance-of-retreats-for-a-remote-company/)时拿来娱乐一下。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
让它自动地继续运行 => 让它自动地连续运行
|
||
- **Symbol:**`-[UIApplication sendAction:toTarget:fromSender:forEvent:]` | ||
|
||
Stops when an event is delivered, such as the touch of a button. This is pretty similar to the one above. Activate this breakpoint if you do not know what method a button calls on touch. `p (SEL)$arg3` will print the selector that is invoked and `po $arg4` the target it is invoked on. | ||
当有事件发出时中断,例如按钮的触摸。这和上面那个很相似。激活这个断点,如果你不知道按钮被触摸时调用了哪个方法的话。`p (SEL)$arg3` 会打印出调用的选择器,`po $arg4` 会打印调用它的目标。 | ||
|
||
- **Exception Breakpoint:** Objective-C |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是否需要翻译?
|
||
- **Symbol:**`-[UIApplication sendAction:toTarget:fromSender:forEvent:]` | ||
|
||
Stops when an event is delivered, such as the touch of a button. This is pretty similar to the one above. Activate this breakpoint if you do not know what method a button calls on touch. `p (SEL)$arg3` will print the selector that is invoked and `po $arg4` the target it is invoked on. | ||
当有事件发出时中断,例如按钮的触摸。这和上面那个很相似。激活这个断点,如果你不知道按钮被触摸时调用了哪个方法的话。`p (SEL)$arg3` 会打印出调用的选择器,`po $arg4` 会打印调用它的目标。 | ||
|
||
- **Exception Breakpoint:** Objective-C | ||
*Debugger command:*`po $arg1` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是否需要翻译?
|
||
- **Exception Breakpoint:** Objective-C | ||
*Debugger command:*`po $arg1` | ||
|
||
Stops when an Objective-C breakpoint is hit, printing the exception to Xcode’s console. | ||
当 Objective-C 断点被触发时中断,并打印相应的异常信息。 | ||
|
||
- **Exception Breakpoint:** C++ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是否需要翻译?
|
||
- **Exception Breakpoint:** C++ | ||
|
||
Stops when a C++ exception is hit. | ||
当 C++ 异常抛出时中断。 | ||
|
||
- **Swift Error Breakpoint** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是否需要翻译?
TODO/user-breakpoints-in-xcode.md
Outdated
|
||
- **Swift Error Breakpoint** | ||
|
||
Stops when a Swift Error is encountered. | ||
但 Swift 错误出现时中断。 | ||
|
||
- **Symbol:**`_XCTFailureHandler` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是否需要翻译?
@fengzhihao123 校对完了吗? |
校对完成@sqrthree |
@atuooo 两位校对者都已经校对好了~ 可以来根据校对意见进行调整了哈 ┏ (゜ω゜)=☞ |
@sqrthree 修改完成 |
已经 merge 啦~ 快快麻溜发布到掘金专栏然后给我发下链接,方便及时添加积分哟。 |
初稿完成 #1925