Hot Code Swapping in Xcode?

前端 未结 4 988
野性不改
野性不改 2020-12-30 05:28

I am doing iOS game development using the cocos2d framework, and I tremendously envy the ability for Eclipse Java programmers to hot swap their code while they are debugging

4条回答
  •  礼貌的吻别
    2020-12-30 05:31

    You can hot swap a variable value in Xcode by:

    expression = ;.

    By having a break point in the place where you wanna change the value and doing the command in Xcode console.

    Example:

    // Messages From Console
    (lldb) expression graphFlag = @"X";    // Update variable value
    (__NSCFConstantString *) $0 = 0x36f95718 @"X"  // Xcode prints the updated value
    (lldb) expression graphFlag; // Printing value through expression command
    (__NSCFConstantString *) $1 = 0x36f95718 @"X" // Hot Swapped variable value
    

提交回复
热议问题