Presenting BlockAssert

Assertions are a great tool. As an Objective-C programmer, I use NSAssert and NSCAssert liberally. For various reasons, you sometimes can’t use NSAssert in a block easily. I’m going to explain why and describe a new macro, BlockAssert, which solves this.

C99 initializers

You probably know CGRectMake, but did you know it’s not the only way to make rectangles? It’s not even the best way, really. There’s also C99 initializer syntax. The main advantage to the C99 syntax is that it gives you some very Objective-C like syntax, where the fields are close to the values rather than… Continue reading C99 initializers

Why you should use instancetype instead of id

In my previous entry, I discussed when id will be promoted to instancetype. But now that I’ve explained this, I’d like to explain why you should understand this but not rely on it. Instead, you should use instancetype directly. Let me start with this bold statement, then I’ll back up and explain it: Use instancetype… Continue reading Why you should use instancetype instead of id