Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xcode/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Xcode | LLDB:线程跳转-b1内部闭包_Xcode_Lldb - Fatal编程技术网

Xcode | LLDB:线程跳转-b1内部闭包

Xcode | LLDB:线程跳转-b1内部闭包,xcode,lldb,Xcode,Lldb,我有以下使用RxSwift和RxCocoa的代码。我遇到的问题是,当我尝试使用lldb命令thread jump-b1设置一个跳转一行的断点时,我得到错误:执行被中断,原因:EXC_BAD_访问(code=1,address=0x7fb8ecc0b9) 在尝试跳过闭包内的代码行或通过断点执行闭包中的代码时,是否需要执行其他操作?我在回答以下问题时谈到了线程跳转的危险性: 您是否以及如何因跳过代码而陷入麻烦取决于您跳过的代码。如果您真的想了解这些问题,您需要查看正在跳过的代码的反汇编。但编译后的

我有以下使用RxSwift和RxCocoa的代码。我遇到的问题是,当我尝试使用lldb命令
thread jump-b1
设置一个跳转一行的断点时,我得到错误:执行被中断,原因:EXC_BAD_访问(code=1,address=0x7fb8ecc0b9)


在尝试跳过闭包内的代码行或通过断点执行闭包中的代码时,是否需要执行其他操作?

我在回答以下问题时谈到了
线程跳转的危险性:

您是否以及如何因跳过代码而陷入麻烦取决于您跳过的代码。如果您真的想了解这些问题,您需要查看正在跳过的代码的反汇编。但编译后的代码通常不是独立的单元,其中一些是可选的。因此,虽然这是一种有用的技术,但并不总是保证成功

import UIKit

class ViewController: UIViewController {

    @IBOutlet weak var buttonPressedLabel: UILabel!
    @IBOutlet weak var button: UIButton!

    private var counter = 0

    override func viewDidLoad() {
        super.viewDidLoad()

    }

    @IBAction func buttonWasPressed(_ sender: UIButton) {
        let closure = { [unowned self] in
            print("1st line of closure")
            self.counter += 1
            self.buttonPressedLabel.text = "Button Pressed \(self.counter) times"
            print("2nd line of closure")
        }
        closure()
    }


}