Monthly Archives: January 2011

Print a stack trace anytime

Here’s how to print a stack trace from code at any point in your app – no need to wait for a crash report! – NSLog(@"%@", [NSThread callStackSymbols]); That requires iOS 4.0+. There are some easy-to-use C functions that do the same thing: #import <execinfo.h> #import <unistd.h> void PrintStackTrace() {   void *stackAdresses[32];   int […]

Printing in iOS

This post gives a quick introduction on how to print in iOS 4.2+. There are multiple ways to interact with AirPrint, but for brevity I’ll focus on printing a single PDF document.  This actually covers a lot of cases, since anything you can draw in Quartz can be drawn into a piece of PDF data […]