3 Good Habits for Avoiding Memory Leaks in Objective-C

I have been developing software in Objective-C for quite some time now, but I continue to discover new ways to shoot myself in the foot, particularly in the way of memory management. A while back, I wrote a post about finding iOS memory leaks using Xcode’s Instruments. This is a great tool for discovering memory leaks and tracking them down. But ideally, we would not have to deal with Objective-C memory leaks in the first place! The best way to avoid these types of problems is to stop them before they start.
Read more on 3 Good Habits for Avoiding Memory Leaks in Objective-C…

IDE Knows the Trouble I’ve Seen

If you have ever found yourself working on iOS and Android projects, you’ve probably had to decide which IDE or text editor to use. Unfortunately, there are not a lot of options to choose from when it comes to native projects; however, this means that choosing an IDE is significantly easier. Android Studio is a great choice for Android development, and if you want to keep your environment consistent, AppCode is an excellent product.
Read more on IDE Knows the Trouble I’ve Seen…

ReactiveCocoa – Cleaning Up after replay, replayLast, and replayLazily

A while back, I wrote a post comparing replay, replayLast, and replayLazily. Thanks to some investigating by Brian Vanderwal, I recently learned that one needs to be careful when using a replay operator (or multicast/connect directly) with an infinite signal as its source.

This blog post refers to the older ReactiveCocoa 2.x Objective-C library. I’m guessing that the newer Swift versions have the same behavior, but I don’t actually know for sure.
Read more on ReactiveCocoa – Cleaning Up after replay, replayLast, and replayLazily…

Objective-C Value Objects: Code Generation

In my previous post, I talked about using Value Objects in Objective-C projects. I gave an example of a Ruby DSL that could be used to specify the object’s properties so the code could be generated.

In this post, I’ll go through some Ruby code that can turn that DSL into an Objective-C header and implementation file. Read more on Objective-C Value Objects: Code Generation…

Simplifying Objective-C Value Objects with Mantle and the Builder Pattern

I’ve come to the conclusion that regardless of how “functional” a programming language is, the best way to handle state is with immutable value objects.

Wikipedia defines a value object as follows:

“In computer science, a value object is a small object that represents a simple entity whose equality is not based on identity: i.e. two value objects are equal when they have the same value, not necessarily being the same object.

Value objects should be immutable: this is required for the implicit contract that two value objects created equal, should remain equal. It is also useful for value objects to be immutable, as client code cannot put the value object in an invalid state or introduce buggy behaviour after instantiation.”

I’ve found that immutable value objects are particularly well suited for passing data around when using one of the Reactive Extensions libraries. While not a direct port, I lump ReactiveCocoa into the same category, and it benefits just as much by sending Objective-C value objects on its signals/streams.
Read more on Simplifying Objective-C Value Objects with Mantle and the Builder Pattern…

Working with Objective-C and Swift on the Same Project

I know I’m a little late to the game, but I just recently started playing around with Swift, Apple’s new flagship language for developing apps for iOS, OS X and Apple Watch. Rather than starting a completely new project using only Swift, I thought it would be an interesting challenge to start with some Objective-C and try converting a class or two to Swift. Having heard that it’s possible to mix the two languages within a single project, I set out to see how difficult that would be. Here are a few things I learned throughout the process. Read more on Working with Objective-C and Swift on the Same Project…

Objection Turns 4, Gets 1,000th Follower

Objection is a dependency injection framework for Objective-C that I wrote in one day 2011 while working on an iOS project. It’s funny how a combination of frustration with existing tools and inspiration can create something of value for your company and the wider development community.

Objection turned 4 years old this year and has just recently exceed 1,000 watchers on GitHub. I never thought that Objection would to continue to grow in popularity and be updated regularly through its 4 year tenure, but I am glad it did. Read more on Objection Turns 4, Gets 1,000th Follower…

Bi-directional Data Bindings in ReactiveCocoa with RACChannel

ReactiveCocoa is a functional-reactive framework for Objective-C that can be leveraged to manage the flow of data within an application. The API provides tools that enable the composition of complex streams that chain data sources to data consumers. Typically, data travels down these streams in one direction—from source to consumer—but on occasion, it’s necessary to have data travel in both directions. This is where the RACChannel feature can be used. Read more on Bi-directional Data Bindings in ReactiveCocoa with RACChannel…