There's a simple difference and a deeper one.
The simple answer is that the first method includes an +alloc
/-init
pair internally—the documentation tells us that it returns a new date object initialized to the current time. Generally, somewhere, somebody has to call +alloc
and an -init
method of some sort. Sometimes that's you, sometimes a convenience method has been included for you.
The deeper answer about the difference is that +alloc
/-init
returns an object that is owned by the caller, who is then responsible for calling -release
at some point, while convenience constructors that don't start with the words "alloc" or "new" return autoreleased objects that you don't have to release. However, if you are using ARC, this is mostly academic, as the compiler tracks that detail for you.