Objective-C property proposal: mainthreadonly

I’d like to propose a new language feature for Objective-C, a property attribute that would indicate that a property should only be set from the main thread.

Let me be clear: Objective-C does not do this. But wouldn’t it be cool if it did?

Continue reading “Objective-C property proposal: mainthreadonly”

Trimming a level of indent with @synchronized and @autoreleasepool

I haven’t seen this discussed anywhere, but you can eliminate a level of indentation when using @synchronized and @autoreleasepool blocks in a loop or conditionally. This falls naturally as a result of the way the C language works, and how these blocks work, but it took me a while to realize it.

Continue reading “Trimming a level of indent with @synchronized and @autoreleasepool”


Apple has a sample code package called Reachability. It wraps an iOS framework called SystemConfiguration, and can be used to determine network status, and catch events about networking going up and down. In the past, it’s been an ugly chunk of sample code, but it’s pretty respectable now.

One thing Reachability is not, however, is a crystal ball. Please don’t use it as if it were.

In this article, I’m going to discuss how to use it. Because this is one thing I see a lot of developers get wrong.

Continue reading “Reachability”

You don’t have to have 16:9 on day 1

You don’t have to build with armv7s right away.

And despite user demands, you also don’t have to support 16:9 right away either.

It’s fine to get real hardware into your hands. More than fine; it’s being responsible. Apple has you covered with letter boxing; let the 16:9 screen be their problem until you’re really ready to take full responsibility. By all means, do whatever development and simulator testing you want now. But wait for real hardware to ship.

Always measure before cutting.

(But measure and cut quickly.)