PNG compression in Android… (You have got to be kidding)

Over the last few weeks, I've been learning the Android SDK in an effort to bring Layers to Android devices. It's going pretty well, but every once and a while I run into a truly WTF moment. Tonight I was importing some images from the iPhone version of Layers when I noticed that Android seems to visibly reduce the quality of PNG files at compile time. In images with ... More...

iPhone Development Tutorial

I gave a presentation within the Engineering school on Friday that gave a brief look at the iPhone platform and Objective-C. The end of the presentation was a quick tutorial in Interface Builder and XCode. You can download the presentation and the tutorial project here: iPhone Development Tutorial iPhoneDevelopmentTutorial.zip If you have any questions, feel free to email me ... More...

Layers featured in Macworld Article on iPhone Piracy!

The piracy statistics I posted earlier this month have gathered some attention, and Nick Spence at Macworld.co.uk is running an article about the price of piracy for independent software developers. Check it out! iPhone App piracy: Small time developers feel the pinch UPDATE: The article was pushed to Macworld.com as well! More...

App Store Piracy: Worse than you think.

Two weeks ago, a minor update to Layers hit the App Store. The update included several important bug fixes and a few features, but one of the most major changes was the addition of a piracy tracking system. Each time the app is used on a jailbroken device, it phones home with a few (anonymized) metrics so that I can track the spread of pirated copies. Software on ... More...

EXIF Orientation Flags and the iPhone Camera

Alright, I have a rant. Bear with me... Layers just came out this past Monday, and it has this great feature that allows you to add a layer to a drawing from your iPhone's photo library. Simple enough - right? Apple provides the UIImagePicker API, we call a couple functions and get an image back. For most purposes, that would work great! Write some code, test, commit, done. The problem ... More...

Mac OS X Stack Overflow Status Item!

I've become a huge fan of Stack Overflow over the last few weeks. The community there is helpful and fast and there are quite a few questions about Cocoa and Objective-C! It's gotten to the point where I visit SO whenever my code is compiling - so I thought it was time to take matters into my own hands and make things easier to follow. I've made a Stack ... More...

PackBits algorithm in Objective-C

The PackBits algorithm is one of the TIFF data compression methods, and it's also used for pixel data in Photoshop PSD and TGA files. It was originally developed for MacPaint, and although it's still widely used, there isn't a whole lot of information online about it. I spent some time this weekend writing a category to extend the NSData class and support the packBits algorithm, and I think ... More...

Custom compiler flags in XCode

So I've been messing with compiler flags in XCode for the last hour or so, and it turns out I was totally misunderstanding things. If you get info on a project or target in XCode, there's a "User-Defined" section at the bottom that allows you to create your own flags for use at compile time. However, these flags are not actually passed into GCC! (Mistake 1!) I assumed ... More...

Creating a UIImage from a CGLayer

CGLayers are great for drawing - especially when things need to be drawn over and over again. Converting a CGLayer to a UIImage is another story, though. NetSketch uses CGLayers for the drawing canvas, but converts them to UIImages when you go to upload your drawing or email it to a friend. The code below shows how it's done. The CGLayer is drawn into a bitmap CGContext of ... More...

Safari-style iPhone Checkbox

I was finishing up work on an iPhone app earlier today and needed to add a check box to the interface. Interface Builder provides a "checkbox-ish" control that slides between "On" and "Off" states but it didn't fit in well with the rest of the app. I needed a smaller one like the one that Mobile Safari provides for web forms. It was pretty easy to create using a ... More...

Next,