Category Archives: Categories and helper classes

Keeping ViewController files small

If you’re working on a complex iOS app, it’s very easy to create a UIViewController subclass with a huge amount of code. One of the many code guidelines I learned at Google was the simple idea of keeping functions and files small. For example, I would recommend trying to keep the vast majority of your […]

Debug reference counting for any class

In a previous post, I mentioned a trick that I sometimes use to debug memory issues where a class I own is either being released too soon (often resulting in a EXC_BAD_ACCESS exception), or is leaked, resulting in low memory. The main idea was to temporarily override key methods such as retain, release, and autorelease […]

Simplified popovers

In this post, I’ll present a microclass that can give you simplified popover ( UIPopoverController ) handling in many cases, including automatic rotation updates. Links to code below. What PopoverHelper does Normally, this is how you need to work with a popover: Set up the content view controller that will appear in the popover. Alloc […]

let it be

This post explains one of my favorite NSObject categories – one that is extremely universal and handy for shorter and, in my opinion, more memory-manageable¬†code. ¬†(Code below.) Edit: Commenter David found a bug in this implementation. Check out the fixed version here; the new source files are listed at the bottom of that post. (The […]