开发者

How can I see when the value of a variable change?

开发者 https://www.devze.com 2023-03-18 20:01 出处:网络
I have this really nasty bug in my program, which somehow changes the value of my variable.开发者_开发知识库 I have tried setting break points but can\'t find the line of code that\'s the culprit.

I have this really nasty bug in my program, which somehow changes the value of my variable.开发者_开发知识库 I have tried setting break points but can't find the line of code that's the culprit.

Is there any way to pause program execution when there's a line of code that's changing the value of a variable in Xcode 4?


One way would be to find the value changing operations or in general any bug using bisection. Ie. you choose two breakpoints that have the problematic operation in between and move one of them to middle and check if the value still changes. If it does repeat in this halt, if not repeat in the other half.

0

精彩评论

暂无评论...
验证码 换一张
取 消