Display Debug Information In A Popup Window (UIAlertView)

I previously shared the code I use to replace NSLog, as I really don’t care for the date/time stamp that NSLog outputs to the console.

Every now and again rather than looking at the console, it can be helpful to have a popup (UIAlertView) with the same information that one would include in NSLog. Let’s see how to accomplish this…

Assume you have the following code:

NSString *str = @"iOS Developer Tips";
int x = 101;
 
NSLog(@"str: %@ x: %d", str, x);

The output will look as follows:

2013-04-07 23:28:42.404 Sandbox[18767:c07] str: iOS Developer Tips x: 101
Continue reading