关于init方法的一个注记

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了关于init方法的一个注记相关的知识,希望对你有一定的参考价值。

Here is a breakdown of creating a custom initializer and or general rules of init
  1. In summary, this is what an init method needs to do:
  2.  
  3. - Call [super init] and assign the result to self.
  4. - Check whether self is nil. If so, then exit this method right away and return nil to the caller.
  5.  
  6. - If self was not nil, do additional initialization if necessary. Usually this means you give properties and instance variables their initial values. By default, objects are nil, ints are 0 and BOOLs are NO. If you want to give these variables different initial values, then this is the place to do so.
  7. - Return self to the caller.
  8.  
  9. You don’t always need to provide an init method. If your init method doesn’t need to do anything — if there are no properties or instance variables to fill in — then you can leave it out completely and the compiler will provide one for you.

以上是关于关于init方法的一个注记的主要内容,如果未能解决你的问题,请参考以下文章

关于向量值函数方程变分的一点注记

关于向量值函数方程变分的一点注记

ArcGIS微课1000例0038:注记(Annotation)的使用方法

关于主定理的几点注记

ArcGIS微课1000例0039:ArcGIS注记转CAD注记的方法

几个关于js数组方法reduce的经典片段