Efficient Exception Debugging with Xcode 4

When dealing with Objective-C exceptions while developing Cocoa applications, you might not know where the error happened. Calling -[NSMutableDictionary setObject:forKey:] with an nil object will output an error message in the console (*** -[NSCFDictionary setObject:forKey:]: attempt to insert nil value (key: myKey)) but the application doesn’t crash. Unlike in iOS, the program execution doesn’t stop and you don’t get a stack trace.

You can tell Xcode to stop executing the application on exceptions by setting an Exception Breakpoint in the Breakpoint Navigator (Command-6).

AddExceptionBreakpoint ExceptionBreakpointPopover

When your application hits an exception Xcode will stop the execution, but you might not know what kind of exception was thrown.

ExceptionSource

After reading Apple’s Technical Note TN2124 “Mac OS X Debugging Magic”, I found a solution. In Some Assembly Required you can find the register addresses of the function return values, which will be the NSException object. Now all you have to do is to configure an action to print the exception to the console. In case of Intel 64-bit, the command would be po $rax, for Intel 32-bit it’s po $eax.

ExceptionBreakpointWithDebuggerCommand ExceptionMessage

Posted in Apple, Developer, Mac | Tagged , , , | Comments Off

Introducing PageKit

Over the years I have created a few JavaScript classes which I use in various web applications. Today, I released two of them on GitHub: PageMenu and PageList, part of PageKit. To see what is it about, head over to the project page at fjoachim.github.com/pagekit. I’ll ad more classes eventually.

Posted in Developer, JavaScript, Web | Comments Off

SiteCapture v1.2.1 Released

I just released SiteCapture v1.2.1 which has following changes:

  • 64bit support on Intel Macs
  • Feature to reveal the destination folder in the Finder
  • Enhanced image quality for PDF thumbnails

SiteCapture now requires Mac OS X v10.5 Leopard.

Grab it at www.sitecapture.net.

Posted in Mac, Software | Comments Off

Introducing WebKitTool

WebKitTool.pngWebKitTool is a simple command line tool using Apple’s WebKit framework for converting web pages to PDF- or image files.

When creating PDFs, you can either create one page containing the whole web page or multiple pages, landscape or portrait.

Examples

Creating a single page PDF of www.google.com:

./WebKitTool www.google.com google.pdf

Creating a multipage PDF of www.engadget.com:

./WebKitTool -p http://www.engadget.com engadget.pdf

Creating a big PNG image of www.engadget.com:

./WebKitTool http://www.engadget.com engadget.png

Availability

The tool is 100% open source. The source code and the universal binary are hosted on GitHub. WebKitTool requires Mac OS X 10.4 or later. Enjoy!

Posted in Mac, Software, Terminal | Comments Off

Introducing PDFKitTool

PDFKitTool is a simple command line interface to Apple’s PDF Kit framework.

With it, you can manipulate PDF documents. It can combine several documents into one or burst multipage documents into multiple single-paged documents.

Examples

Combining multiple documents and storing the result to disk:

./PDFKitTool load one.pdf load two.pdf cat output combined.pdf

Bursting a multipage document into multiple single-paged documents:

./PDFKitTool load multipage.pdf burst output bursted.pdf

Availability

The tool is 100% open source. The source code and the universal binary are hosted on GitHub. PDFKitTool requires Mac OS X 10.5 or later. Enjoy!

Posted in Mac, Software, Terminal | Comments Off

Size Comparison: new 27″ iMac vs old 24″ iMac

It’s intresting to see that the new 27″ iMac is nearly as tall as the old 24″ model.

iMac size comparison

Posted in Apple, Hardware, Mac | 2 Comments

RedLaser Barcode Scanner

It’s just astonishing that the RedLaser app can recognize barcodes using every iPhone, even the old models (original iPhone and iPhone 3G) which have no autofocus camera and produce blurry images like this one:

IMG_0004.PNG

I’m surprised the app was accepted in the App Store – it obviously accesses the live video feed for which there is no public API available.

Posted in iPhone, Software | 1 Comment

SiteCapture 1.2 Released

I just released SiteCapture v1.2 and made it Freeware!

New features include:

  • Full-size captures now contain the full height of a page.
  • When multiple URLs only differ in their query string, the file names of the images won’t collide anymore.

Grab it at www.sitecapture.net.

Posted in Mac, Software | Comments Off

Adobe AIR Pollutes the Keychain

Why does every Adobe AIR application need a separate Keychain? I don’t understand.

airkeychains.png
Posted in Software | Comments Off

Android Detail Bashing, Part 1

What happens when you connect the charger after the “Please connect charger” message appears? Nothing.

connectcharger

Posted in Mobile, Software | Comments Off