Objective-c: Questions about self = [super init]

前端 未结 8 1187
鱼传尺愫
鱼传尺愫 2020-12-12 23:01


I have seen self = [super init] in init methods. I don\'t understand why. Wouldn\'t [super init] return the superclass? And if we point

8条回答
  •  臣服心动
    2020-12-12 23:13

    I would think of it as, init'ing all the supers variables etc, then you get to init your extended classes variables before it is returned.

提交回复
热议问题