Objective-C Blocks Cheat Sheet

Posted by on Dec 6, 2012 in iOS, iPad, iPhone, Mac OS X | 6 Comments

Blocks are an incredibly powerful addition to Objective-C, introduced in iOS 4. However, their syntax can be maddeningly difficult to remember. Matt Gallagher has an excellent post that breaks down the syntax to help you understand it. If you haven’t read this article, go do it now. Even after working with blocks for a while, […]

GSM 0338 encoding for SMS

Posted by on Aug 27, 2012 in iOS, Mac OS X, Mobile Applications | One Comment

Here’s a little Objective-C helper class we wrote to make it easier to convert NSString’s to GSM 03.38 encoding on the iPhone, iPad, or Mac: Handles stripping out characters not included in the GSM0338 character set Calculates the length of a GSM 0338 string (e.g. ^,[,|,etc each require 14 bits instead of 7 Gives you […]

Kickstart your apps with the iOS Xcode Starter Project

Kickstart your apps with the iOS Xcode Starter Project

We created the iOS Xcode Starter Project to make it quick and easy to start a new iPhone or iPad app. Our goal was to create a template to save the hours of effort it takes on a new project configuring essential open source libraries, the unit and functional testing environments, analytics, multiple targets, multiple […]

Block initialization for testability and reuse

Block initialization for testability and reuse

Since Apple introduced block support in iOS 4, more and more APIs are moving from delegation to block callbacks. While block callbacks can be declared inline, in most cases you should initialize your block callback in a method that returns the block. This keeps the code that calls an external API succinct, allows you to […]

The reviews are in!

So be honest: What’s your answer to the question “Do you enjoy reading the latest app store reviews for your app?” (a) “Our users are so smart, kind, and thoughtful that I relish the chance to read their pearls of wisdom.” (b) “Unless they’re written on the bottom of a pint glass, no.” (c) “I’d […]

TechCrunch covers FarFaria, the new iPad app we helped out on

Posted by on Apr 15, 2012 in iOS, iPad, Mobile Applications | No Comments

TechCrunch covers FarFaria, the new iPad app we helped out on

Enable memory warnings in the iOS simulator to catch crash issues

Enable memory warnings in the iOS simulator to catch crash issues

One common crash issue that’s tough to catch during iOS development of UIViewControllers is the unloading and re-loading of views due to memory warnings. The viewDidUnload method ONLY gets called when a memory warning comes in, NOT as part of the regular view lifecycle. During development it’s likely you may never get a memory warning, […]

Use NLC to simulate flaky mobile networks when testing

Use NLC to simulate flaky mobile networks when testing with NLC

Reduce iOS memory utilization by taming NSURLCache

Reduce iOS memory utilization by taming NSURLCache

If your iPhone or iPad app embeds UIWebViews or makes HTTP requests directly with NSURLConnection, it’s important to keep an eye on memory utilization by running it through the profiler occasionally. Web requests can use a lot of memory, and you may find the memory footprint grows and grows the more you use the app. […]

Initializing UIViewControllers

Initializing UIViewControllers

Most code samples that Apple provides for initializing a view controller look something like this: 
MyController *myController = [[MyController alloc] initWithNibName:@"MyView" bundle:nil]; This always felt like a strange pattern to me. And as Ole Begemann recently pointed out, it’s poor encapsulation. Why does the caller specify which .xib file some other controller should use? Isn’t […]