关于init方法的一个注记
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了关于init方法的一个注记相关的知识,希望对你有一定的参考价值。
Here is a breakdown of creating a custom initializer and or general rules of init
In summary, this is what an init method needs to do: - Call [super init] and assign the result to self. - 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. - Return self to the caller. 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)的使用方法