Best iOS and Mac Development-Related Links: May 2011

Here is my summary of the past month in links:


The story of the month was certainly that of patent troll Lodsys. In chronological order:

On May 13th, James Thomson tweeted that he was threatened with a patent infringement lawsuit over in-app purchase by (what we later learned) Lodsys, together with handful of other small developers.

While the developer community waited for Apple to respond, Lodsys tried to explain themselves to the public in a series of blog posts. Craig Grannell took them apart. Meanwhile, the EFF asked Apple to stand up and defend their developers and Mike Lee proposed that developers boycott the in-app purchasing API to show both the patent trolls what we think and Apple what we expect of them:

What I propose is this: for every API that is infected by parasites, we cut off the branch and boycott the API. I don’t think it’s unreasonable to expect to be able to use an API without being sued, the same way it’s not unreasonable to expect to use an API without getting spam.

Craig Hockenberry of the Iconfactory wrote an open letter to Steve Jobs. With the deadline set by Lodsys approaching, some people reasonably started suggesting for targeted developers to cooperate with Lodsys in order to avoid a very costly lawsuit.

On May 23rd, Apple finally responded publicly by publishing a letter sent to Lodsys, claiming that app developers are protected by the license Apple has acquired to the Lodsys patents.

Many expected Lodsys would now retract their claims and this would be over, others warned that Lodsys could still decide to sue. And that’s what they did: in response to Apple’s letter, on May 31st Lodsys publicly disputed Apple’s assertion that their license covers app developers and announced that they have sued seven relatively small iOS app developers, among them the Iconfactory and Quickoffice.

Florian Mueller at FOSS Patents has covered not only that last part but the whole case extensively.

Unfortunately, this story is not over yet. I can’t imagine how bad it must feel to be faced with such a meaningless and potentially destructive lawsuit. I really hope we as a community can do our best to help those unlucky seven. Also, let’s not forget that while the Lodsys case gets all the attention, a company named MacroSolve has also sued small developers over patent infringement.

It will be interesting to see if Steve Jobs decides to talk about it during the WWDC keynote next week. I think it would mean a lot to developers if he did.


Let’s move on to happier news:

  • DCIntrospect by Domestic Cat Software is a very clever library that helps you debug your user interfaces in the iOS Simulator. Similar to CSS box-model visualizers, it can outline the dimensions and other properties of your views, and by integrating with the Mac’s keyboard, it doesn’t interfere with the rest of your app.

  • Matt Gallagher posted a set of reusable classes for fetching and parsing XML or JSON via HTTP. This is not so much about the code itself (which is quite straightforward to write) but about the design: it is much better to put your network and parsing code into reusable classes than to stuff it directly into your view controller class.

  • Nice tutorial by Saul Mora on how to make Core Data work in a multithreaded environment with the help of blocks and GCD.

  • Sam Vermette wrote SVSegmentedControl, a customizable version of UISegmentedControl. It animates when switching from one segment to the next, similar to both UISwitch and the redesigned tab views Apple had used in the first developer previews of Mac OS X Lion but now seems to have abandoned. Looks great.

  • Benjamin Godard has published NYXImageUtilities, a collection of useful UIImage categories for filtering, resizing, masking, rotating, and saving to different file formats.

  • Gustavo from CodeCrop has written a useful NSMutableDictionary category that knows about image metadata such as geo coordinates and EXIF data. It makes saving an image with metadata very easy.

  • Noel Llopis blogged about the difficulties in achieving determinism (something we usually taked for granted when working with computers) in his new game Caseys’ Contraptions:

    Same input should create the same output. Not really. We’re missing the most crucial input: The timer. Casey’s Contraptions runs at 60 fps on an iPad one, but the timestep isn’t set to a fixed 16.667ms. Instead, I use a high-resolution timer to measure how much time has really elapsed since last frame, and I advance the simulation by that much. The problem is that the timer doesn’t always return the exact same amount. It’s not super-precise, and it can be slightly affected by other things going on in the device. It won’t be off by more than 1/10th of a ms, but that’s enough to cause different results and start diverging the simulation.

  • Mike Ash explains how NSZombies work, our favorite debugging instrument for finding memory management bugs. If you suspect some serious behind-the-scenes magic, it is surprisingly simple and straightforward (a feeling I often get when looking under the hood of Objective-C and the runtime).

  • Martin Pilkington dives deep into the Objective-C Runtime: Dynamic Tips & Tricks with Objective-C.

  • Another great tutorial by Ray Wenderlich: How to make a space shooter game with Cocos2D.

  • Microsoft introduced a Bing Maps Control for iOS. The API is very similar to MKMapView.

  • Kelly Sommers picks up a topic that I am sure many of us have thought about: Continuous Client: Our multi-device dream but how do we build it? When we all have multiple computer-like devices, how can we transfer one device’s state to another when we switch devices? Kelly proposes that we design our apps with the Continuous Client concept in mind to make it easy to actually implement it when the time has come (did anybody say iCloud?). Specifically, think about using NSNotification to signal UI interactions in your app:

    If you are an iOS deveoper are you using NSNotificationCenter? If you are using these mechanisms to publish and subscribe UI interactions you are well on your way already. The more your software is designed around messages the easier your system can be automated without special code required because your system is natively written to handle these messages.

  • In Regarding Objective-C & Copland 2010 Guy English talks about John Siracusa’s articles and podcast about the future and longevity of Objective-C and Cocoa. Guy does not share John’s prediction that to stay competitive, Apple will need to replace Objective-C with a newer, higher-abstraction language in the coming five to ten years; he makes some very good points that Objective-C is actually very well positioned in the competitive landscape of programming languages. I still tend to side with John Siracusa here, though not necessarily with his argument that automatic memory management is the key issue. In my opinion, the downsides of Objective-C’s C heritage show in more aspects than just memory management, from syntax to complexity (why again do app developers have to deal with countless different types for integer numbers?).

Update July 3, 2011: Tim Wood of the Omni Group compared the performance of different techniques to create a drop shadow on iOS. Great post.


App Store

  • Users who got your app through a promo code are no longer able to leave a rating or review for it on the App Store.

    According to Apple representatives, the change has been made in order to help prevent developers from gaming the ratings and reviews system by using an entire batch of promo codes to boost their profile.

  • In a post titled Top Grossest Apps, Neven Mrgan talks about the meaninglessness of the Top Grossing list in the App Store since Apple includes in-app purchases in that list:

    Then Apple added in-app purchases and decided to include those when calculating apps’ earnings for the Top Grossing list. The result? The list is completely dominated by fake-money compulsion engines.

  • There are now more than 500,000 apps in the iOS App Store. 148apps, Chomp and Chilingo created a huge infographic about the history and current state of the App Store: the 500,000 apps have been created by 85,000 developers. Close to 40% of all apps are free. While the average price of a paid app is $3.64 (note that averages probably have little meaning in the distribution of App Store apps), almost half of all paid apps sell for $0.99, and another 20% are $1.99. The median price of a paid app is $1.99. Interestingly, the average price level has been more or less constant since late 2008. With 15% of all apps, games are the single biggest category (closely followed by ebooks), but the percentage of games was even higher (24%) when the App Store launched.