Skip to content

Demonstrates an Xcode 10 issue where breakpoints inside of a defer block are not hit.

Notifications You must be signed in to change notification settings

intere/DebugDeferBlocks

Repository files navigation

Debug Defer Blocks

I spent about an hour trying to figure out why I was seeing logging, but no breakpoints being hit (in Xcode Version 10.0 (10A255)).

It seems that any code inside of a defer block will have its breakpoints skipped.

Update (10/12/2018)

Apple emailed me today, telling me that this is a duplicate of another radar:

Hello Eric,

Engineering has determined that your bug report (45048050) is a duplicate of 42858960 and will be closed. 

Reproducing this issue

  1. Clone this project
  2. Set breakpoints in ViewController.swift at lines 17 and 20
  3. Run the project

You'll notice that the breakpoint at line 20 fires, but the breakpoint at line 17 never fires.

Workaround

Here's a workaround for this issue Despite the breakpoint at line 17 not being hit a breakpoint inside of a function that's called from the defer block is hit!

Reference Screenshot

Open Radar

I've filed a Radar ticket for this issue, and added it to Open Radar #5048329775874048

About

Demonstrates an Xcode 10 issue where breakpoints inside of a defer block are not hit.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages