Category: Programming

Promises: basics

In my previous article, I introduced the concept of promise, a technique that allows us to write async code in a more sync-ish manner. In this article and the following ones I will try to dive into the definition and expectancies of a promise. So what is a promise? A promise represents the eventual result of an asynchronous operation. This […]

Setters in Cocoa

Which of the three setters is better: [objc gutter=”false”] – (void)setName:(NSString*)value{ if(value != name){ [name release]; name = [value retain]; } } – (void)setName:(NSString*)value{ id old = name; name = [value retain]; [old release]; } – (void)setName:(NSString*)value{ [name autorelease]; name = [value retain]; } [/objc] Personally I’d use the third variant, but I’m open to […]

« Previous Page