博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
objective-c init方法的写法
阅读量:4250 次
发布时间:2019-05-26

本文共 796 字,大约阅读时间需要 2 分钟。

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.

from objective-c-programming

转载地址:http://hxkei.baihongyu.com/

你可能感兴趣的文章
Java进阶之面向对象(一)——继承
查看>>
Java进阶之自定义ArrayList&斗地主发牌案例
查看>>
JavaWeb之filter&listener&文件上传
查看>>
JavaWeb之Ajax&json
查看>>
BUFG,IBUFG,BUFGP,IBUFGDS等含义以及使用
查看>>
转载:在 Windows 10 下遇到移动硬盘不自动分配盘符的问题
查看>>
DDR2 SSTL_18标准
查看>>
DDR3的DQS_p/n信号电平摆幅变化不一致现象
查看>>
北大旁听生中的历史名人
查看>>
大唐凌烟阁开国廿四将
查看>>
Access数据库出现"Selected collating sequence not supported by the operating system."错误
查看>>
逻辑思维测试题
查看>>
如何用Easy CHM制作CHM格式电子书(帮助文档)
查看>>
为什么学习python
查看>>
华为进不了美国,并不是贸易保护这么简单
查看>>
markdown文件的基本常用编写语法(图文并茂)
查看>>
java变量简介
查看>>
Shell十分钟入门
查看>>
nginx 配置 upstream backup 报错
查看>>
Linux执行 wget命令:提示command not found的两种解决方法
查看>>