New “When In Use” Location Tracking in iOS 8

Posted by on Sep 12, 2014 in code, iOS | No Comments

If your app tracks the user’s location, you may notice when you run it in iOS8, the location tracking alert asks for permission to “access your location even when you are not using the app“. If your app only accesses the user’s location when the app is running, you can present a less scary message […]

Frame geometry macros to improve your UIKit code

I find myself doing more and more dynamic UI layout in iOS apps these days. When elements of a UI need to resize to fit their contents, or move to accommodate other elements, the layout code can get complex and verbose. We’ve developed a set of Objective-C UIKit macros that help make this code more […]

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 […]

Git stash to store frequently used edits

Posted by on Dec 20, 2011 in code | One Comment

We work on a couple of projects that require specific changes to test a particular configuration, for example to test against a local server. We generally put this kind of configuration into a plist file and create a target that builds using that plist. Sometimes, however, that’s not convenient–for example, there may be several different […]

Using DiffMerge as your Git visual merge and diff tool

Posted by on Aug 17, 2011 in code, Git, Mac OS X, Software Development | 38 Comments

Our favorite (and free) visual diff and merge tool for OS X (as well as Linux and Windows) is DiffMerge. It makes resolving nasty Git branch conflicts a snap (relatively speaking). Here’s how to install it and configure it with Git on OS X: Download the DiffMerge OS X installer. Be sure to download the […]

Can’t symbolicate XCode4 archive builds?

Posted by on Apr 6, 2011 in code | 11 Comments

Update: symbolication is fixed in Xcode 4.1. Check this post for troubleshooting tips if you’re still having problems. Since XCode 4 was released, several iOS developers have reported that their crash reports are no longer symbolicated correctly, meaning that they can’t trace crashes to the code that caused them. I’ve traced this problem down to […]

Some great UIColor resources

Posted by on Mar 6, 2011 in code | 3 Comments

I’ve recently come across some nice resources for working with UIColors. Developer Color Picker Developer Color Picker is a color picker built for, you guessed it, Objective-C developers. Just install it in ~/Library/ColorPickers and it will appear in any application when you pull up the color picker. You can switch between RGB and HSB sliders […]

Mocking singletons with OCMock

Posted by on Feb 28, 2011 in code | 20 Comments

Although Graham Lee might not approve, I occasionally use the singleton pattern, particularly for managing access to my data models. Singletons in Cocoa are accessed using the following convention: static UserModelManager *sharedManager = nil; +(UserModelManager *)sharedManager {     if (sharedManager == nil) {         sharedManager = [[super allocWithZone:NULL] init];     […]

Declarative logging in Objective-C

Posted by on Jan 12, 2011 in code | One Comment

I’m currently working on a project with a requirement to log various events using Google Analytics. I created a UsageLogger service to encapsulate all the GA logic and make it easy to turn it off or replace it with another analytics solution. But I didn’t want to have logging methods sprinkled throughout the code, and […]