alloc, init, and new in Objective-C [duplicate]

+new is implemented quite literally as:

+ (id) new
{
    return [[self alloc] init];
}

Nothing more, nothing less. Classes might override it, but that is highly atypical in favor of doing something like +fooWithBar:.

Leave a Comment