Would it be correct/ellegant use only alloc without init?

后端 未结 4 801
[愿得一人]
[愿得一人] 2020-12-28 23:48

If we don\'t want to implement init method in our class, and bearing in mind that init in NSObject only returns an instance of the object without initialization, I don\'t se

4条回答
  •  一生所求
    2020-12-29 00:12

    I think that it is not a good idea.
    Read Cocoa Design Pattern, especially the "Two stage creation"

    You can also read this article http://www.informit.com/articles/article.aspx?p=1398610

提交回复
热议问题