Neil: The hell happened here?
Protagonist: It hasn’t happened yet.
Sator: How would you like to die?
Protagonist: Old.
Neil: The hell happened here?
Protagonist: It hasn’t happened yet.
Sator: How would you like to die?
Protagonist: Old.
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).
When your application hits an exception Xcode will stop the execution, but you might not know what kind of exception was thrown.
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
.
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.
I just released SiteCapture v1.2.1 which has following changes:
SiteCapture now requires Mac OS X v10.5 Leopard.
Grab it at www.sitecapture.net.
WebKitTool 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.
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
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!
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.
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
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!
It’s intresting to see that the new 27″ iMac is nearly as tall as the old 24″ model.
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:
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.
I just released SiteCapture v1.2 and made it Freeware!
New features include:
Grab it at www.sitecapture.net.
Why does every Adobe AIR application need a separate Keychain? I don’t understand.