Instancetype与id的区别和联系

来源:互联网 发布:win7安装数据库没反应 编辑:程序博客网 时间:2024/06/06 08:37

1,instancetype在类型表示上,跟id一样,可以表示任何对象类型

2,instancetype只能用在返回值类型上,不能像id一样用在参数类型上

3,instancetype多了一个好处:编译器会检测到instancetype的真实类型

0 0