Cocoa

5 Nov 2012

Mistakes Were Made: Audio and ARC

ARC silently kills your AVAudioPlayer mid-playback. Here’s why and how to fix it. Spoiler: make it an ivar, and maybe file a radar while you’re at it.

15 Oct 2012

SMPageControl: UIPageControl’s Fancy One-Upping Cousin

A drop-in UIPageControl replacement with custom dots, images, and per-page indicators. Swap class names, tweak diameters and margins, or go full Dribbble with per-page custom indicator images.

27 Aug 2012

Premature Completion: An Embarrassing Problem

Core Animation runs your completion block early if it doesn’t find any animations. Rude. Includes a sample project to poke at the behavior yourself and avoid hours of confused debugging.

16 Mar 2012

SMShadowedLayer

A CALayer subclass that fakes realistic lighting and shadows during Core Animation. Uses Lambert illumination math and a custom animatable property to keep shading correct mid-transform, specular highlights included.

12 Dec 2011

Cancel dispatch_after

A simple wrapper to cancel delayed blocks, because GCD won’t let you. Includes the open-source code on GitHub and a look under the hood at the block-juggling trick that makes it work.

7 Sep 2011

CFTree Is Leaking It’s Children

CFTree’s docs say releasing the root destroys its children. The docs lie. A late-night debugging adventure with proof via Instruments, plus a manual teardown workaround.

26 Jul 2011

(More) Descriptive Logging

Override description on your classes and stop staring at memory addresses in the console. A beginner-friendly walkthrough of making NSLog and GDB actually useful for your custom objects.