码迷,mamicode.com
首页 > 其他好文 > 详细

init

时间:2014-11-27 20:07:59      阅读:153      评论:0      收藏:0      [点我收藏+]

标签:des   ar   for   on   cti   ad   ef   as   new   

Thus, we arrive at the rules that all stylish Objective-C programmers follow when writing initializers:
• If a class has several initializers, only one should do the real work. That method is known as the
designated initializer. All other initializers should call, either directly or indirectly, the designated
initializer.
• The designated initializer will call the superclass’s designated initializer before initializing its
instance variables.
• If the designated initializer of your class has a different name than the designated initializer of
its superclass, you must override the superclass’s designated initializer so that it calls the new
designated initializer.
• If you have several initializers, clearly document which is the designated initializer in the header.

init

标签:des   ar   for   on   cti   ad   ef   as   new   

原文地址:http://www.cnblogs.com/playerken/p/4126933.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!