开发者

Xcode debugger sometimes won't step into a method

Sometimes when I press the "step into" button in the Xcode debu开发者_Python百科gger, it instead steps over the method call.

This happens even though the method is a method I wrote, and the source code is in the same project.

Can anyone explain how to prevent this?


This may also happen when the method is being called on a nil object.

From Apple's developer docs:

A nil value is the safest way to initialize an object pointer if you don’t have another value to use, because it’s perfectly acceptable in Objective-C to send a message to nil. If you do send a message to nil, obviously nothing happens.

This is not necessarily so obvious if you've used pretty much any other language, because they largely don't include this "feature."


I have had issues with LLDB. Switching to GDB corrected this. Product->Edit Scheme->Run->Debugger.


You may need to Clean your targets in XCode. Under the Build menu try Cleaning All and see if that resolves your issue.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜