February 2012
1 post
4 tags
Batch Applying Rounded Corners to Images with...
For the past few years, I have used Picturesque whenever I needed to apply rounded corners to batches of images for one of my web design clients. Picturesque did the job, but its lack of Automator support started getting to me. I had to resort to the ‘Watch Me Do’ action just to apply a preset to an image in a larger image processing workflow.
So recently, I took a day to write a...
September 2011
2 posts
3 tags
Auto-Ejecting Disc Image Files Dragged to the...
Even with the growth of the Mac App Store, I still find myself constantly downloading, mounting, and eventually trashing DMGs. Almost just as frequently, I am greeted with the following dialog whenever I try to empty the Trash with mounted disc image files inside it:
Fortunately for us, we can overcome this annoyance by creating a Folder Action in Automator. Folder Actions run whenever the...
3 tags
Kinect Support for Extreme Tux Racer
Recently, I took a short break from my long-term projects to play around with the official Kinect for Windows SDK. As a mini side-project, I added Kinect support to a classic open source game, Extreme Tux Racer. As Tux accelerates down the racetrack, the user can tilt his or her head left or right to steer the penguin, lean forward to paddle, and lean backward to brake. Tux Racer’s lenient...
August 2011
1 post
5 tags
LLVM, Code Coverage, and Xcode 4
The ability to generate code coverage reports has been one of the notable features missing from the LLVM/Clang compiler. As of June 8, 2011, the Clang frontend can finally generate code coverage reports using the same flags that were supported by GCC. At the time of this writing, these flags haven’t made their way into Xcode’s build settings UI. I have no doubt they will be integrated...
July 2011
7 posts
2 tags
Adding Code Completion Support to TextMate Bundles
Code completion isn’t a prominent feature in TextMate, but it exists. If you enter some text and hit ‘Escape’ repeatedly, TextMate will cycle through any available code completions. Unfortunately, this only works with the Objective-C and PHP bundles, and all functions and methods suggested exclude parameter lists. Compared to the code completion system in Xcode 4, this...
3 tags
AppKit Quick Tip: Populating the 'Open Recent'...
While writing Nibble, my native Apple I emulator for Mac OS X and iOS, I realized an Open Recent menu would be beneficial to users who want to quickly open recently-loaded memory dumps. In standard Document-based applications, AppKit automatically registers newly-opened files as recents. Unfortunately, it doesn’t make much sense to make an emulator a Document-based application.
Luckily,...
3 tags
Enabling VNC on a Mac with a Broken Display
Around two weeks ago, my iMac’s display started turning itself off at random times. I thought this was a software bug as I was running the latest beta of Mac OS X, so I ignored the issue. Doing a quick restart always restored everything to normal. A few days later, the display wouldn’t turn on at all. The Mac would still run and I could hear Alex speak the time every half hour. I ended...
3 tags
AppKit Quick Tip: Highlighting an Entire...
When a user drags any form of data onto a NSTableView configured as a drop destination, the data can be dropped above or on top of any row. Sometimes, it may be preferable to highlight the entire table when a drag enters its bounds, as shown below.
To accomplish this, set your drop row to -1 in the tableView:validateDrop:proposedRow:proposedDropOperation: method, which is a part of the...
3 tags
App Engine Notes
Earlier today, I released fb2cal, a web app that lets users view their Facebook friends’ birthdays right from a native calendaring client. Coming from a desktop development background, writing a web app on top of App Engine was a new experience for me. Some points to take away:
Extend templates to reuse large parts of common HTML code; think inheritance
Leverage the memcache when making...
4 tags
Quick and Dirty Profiling with Blocks
Instruments is an amazing tool for finding all sorts of performance issues in your applications, but sometimes, all you want to do is log a quick and dirty timing of a snippet of code.
Mark Darlymple once posted a quickie that does just this. Unfortunately, the code isn’t very reusable. Each time you want to profile a chunk of code, you need to wrap it in nearly 8 lines of boilerplate...
3 tags
App Store Review Guidelines →
The App Store Review Guidelines and the newly-established App Review Board are huge steps in the right direction. Thank you, Apple.
Update: The introduction seems to be written by Steve Jobs himself, as others already pointed out.
We have over 250,000 apps in the App Store. We don’t need any more Fart apps. If your app doesn’t do something useful or provide some form of lasting...
May 2011
1 post
3 tags
Writing a Bouncing Ball Physics Simulation for iOS
Recently, I have been doing some iOS game development on top of the Chipmunk physics engine. Chipmunk is an exceptionally well-designed library which makes coding some basic physics simulations really fun. The goal of this article is to introduce you to the basics of Chipmunk while creating a bouncing ball physics simulation for iOS. When you tap on your device’s screen, a new ball will be...