Monthly Archives: April 2010

What’s wrong with Flash?

Unless you’ve been living in a cave, you’ve already heard about Apple’s anti-Flash sentiments which were explicitly defended by a public note from Steve Jobs yesterday. My two cents: he’s right, but Apple is still coming across as pushy. The cross-platform blues As a young naïve developer, I once craved the power of cross-platform tools. […]

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

iPad fonts

Below is a graphic listing all the fonts supported by default on the iPad.  It’s a rather tall graphic, so I’ll keep the rest of this short post above it. Here’s the main chunk of code used to generate these images: This is the only method you need to override in your own UIViewController in […]

Detecting orientation

I was surprised to learn today that [[UIDevice currentDevice] orientation] doesn’t always give the correct orientation. In fact, it seems to consistently fail whenever it’s called early in the app launching process. What’s up with that? What’s going wrong If you command-double click on UIDeviceOrientation, you’ll see that this type is an enum defined in […]

UIView + position

Placing and moving your views can be a little tricky if you don’t know the details of UIView’s frame, bounds, and center properties.  This post gives a quick intro to those along with a useful category for working with them (code link below) called UIView+position. frame, bounds, and center These are the three properties of […]

Introducing the Default Delegate design pattern

I recently posted an overview of callback mechanisms in Objective-C, including the pros and cons of delegates versus target/action pairs; in this post I’ll introduce a new design pattern that combines many of the benefits of both of these approaches into a single technique. If you’re building a class to be reused many times, it […]

feeling retained?

This is a quick tip for figuring out why an object is not being released when you expect it to: For the object in question, override retain and release to log their activity. Don’t forget that alloc is always called first, so if you see an equal number of retain and release logs, this means […]