Articles on objective-c

Jonah Williams

Jonah Williams

Writing Reliable iOS Tests

Tests help me write better apps. Writing tests informs my interface designs, expresses some of my intentions, and guards against regressions. As applications grow so do the number of tests I’m running as a regular part of my development workflow. If I’m not careful those growing test suites can slow down, become inconsistent, and eventually

August Jaenicke

August Jaenicke

Using Objection with UIViewControllers and Storyboards

I have used Objection in several iOS projects as a lightweight Dependency Injection framework.  If you’re not familiar with it, take a look.  One pain point has been how to inject dependencies for UIViewControllers that are in storyboards.  Your controllers are likely instantiated through segues or by calling instantiateViewControllerWithIdentifier on a storyboard instance.  Wouldn’t it be nice to

Jonah Williams

Jonah Williams

iOS Integration Tests with Kiwi

I have been using Kiwi to run my iOS projects’ tests. Kiwi works great for defining BDD style unit tests which express the sort of nested assertions I like to write. Unit tests should test code in isolation so that they remain small, fast, and stable. So my unit tests mock or stub any network

Jonah Williams

Jonah Williams

Fixture data for iOS tests

I have talked about running xcode units tests from the command line before. When I’m running tests I often want to load some sort of test fixture data for use in my tests. For example: I might want to keep a file of recorded API responses so that I can stub out network calls. In

Colors
Jonah Williams

Jonah Williams

Customizing the iOS Keyboard

Our applications need input and the default iOS keyboards are often not optimally suited to providing the sort of data we want. When we find that we really wish the keyboard had some extra controls or want to help our users enter a specific set of symbols it is time to customize our apps’ keyboards.

Rudy Jahchan

Rudy Jahchan

Monkey-Patching iOS with Objective-C Categories Part I: Simple Extensions and Overrides

Have you ever wanted to introduce new functionality to base classes in the iOS SDK? Or just make them work a little bit differently? In order to do so, you must enter the wild and dangerous world of monkey-patching. Monkey-patching is extending or modifying the behavior of code at runtime without changing its original source

Rob Pak

Rob Pak

Managing iOS Configurations per Environment in Xcode 4

Update 4/2014 I recommend using .xcconfig files for managing your configurations. Take a look at this post. At Carbon Five we usually have 3 – 4 environments our iOS applications will run against: development, acceptance, staging and production. Often, the property values that are unique across environments are URLs to APIs that we are integrating

Jonah Williams

Jonah Williams

Debug logging with Xcode 4 breakpoints

NSLog calls do not belong in release builds. Logging is slow and the performance impact of log statements on a device can be considerable. Logging is also noisy, it can obscure useful debugging information and may leak information you would rather not expose in a release build. Looking at my device’s system log I see

Jonah Williams

Jonah Williams

Automated ad hoc builds using Xcode 4

I’ve previously discussed Continuous Integration for iPhone Projects in TeamCity using Xcode 3 and Building Xcode 4 Projects from the Command Line. Now I’ll tie those together and use TeamCity to automatically create ad hoc builds I can install over the air (directly onto a device without using iTunes) every time I check in code.

Jonah Williams

Jonah Williams

Building Xcode 4 projects from the command line

The Xcode 4 developer tools introduced some changes to the xcodebuild command line tool. Instead of specifying a project and target developers can now provide a workspace and scheme to build.