Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode debugger sometimes won't step into a method

Sometimes when I press the "step into" button in the Xcode debugger, 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?

like image 380
William Jockusch Avatar asked Dec 22 '22 20:12

William Jockusch


1 Answers

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."

like image 200
MaryAnn Mierau Avatar answered Feb 16 '23 11:02

MaryAnn Mierau