I need to debug a time-critical crash I have in my App and since NSLog does not immediately write to the console I am wondering if there is a way to synchronously write to the console from my code.
So for example is printf a better choice here or would I have to deal with the same problems.
You can add a breakpoint before the crashing line(s), though I think Xcode by default already hangs the proccess so that you can still access the debugger console … If it doesn’t, you may want to add some additional diagnostics by going to Product -> Edit Scheme .. (in the upper menu), such as Guard Edges, Zombie Objects, etc.
In addition, you can call
NSLogfrom the main thread: