Swift Apprentice 4: Chapter 23 - Page 382 - GCD

Hi there,

I am not able to see the “Background thread: Adding numbers… etc” if I write the example code with command-line tool, but I am able to see those logs if I write it in iOS app.

My question is, is GCD work differently in iOS and in Mac command-line tool? That’s why it doesn’t show properly if I use command-line tool for the book example?

Thanks.

1 Like

@choonsiong Thanks very much for your question!

GCD is an API that functions the same way, regardless of either macOS or iOS. What tool are you using? Are you not using Xcode?

Hi! I’m working with Xcode, and the same problems occurs here. Sometimes the “Background thread: Adding numbers…” appears, others don’t. And the “Main thread: The sum is 5050” never appears

@choonsiong @andrerj Do you still have this issue?

I also have this issue with Xcode 10.1 and macOS Mojave 10.14.2

Any ideas here? I’ve got the same issue. No output text when running as a CommandLine app.