New vs alloc init

[[ClassName alloc] init]

[ClassName new]

Which one would you prefer to create an object?

They both do the same thing. However “new” is old. “Alloc init” is favoured more so I would suggest using alloc init. Also with alloc you can use your custom init function.

Leave a comment