objective c - What is the (id) mean in the init method? -
possible duplicate:
what meaning of id?
i newbie ios programming.
i saw following declaration
- (id)init
what (id) mean here?
id
denotes type compatible object. notation
- (id)init
means init
instance method of class; typically it's used initialize instantiated object after memory allocation (usually done using alloc
). in objective-c, methods' return type declared putting type in parentheses before method name. so, here means init
method may return objective-c object.
but should really, google objetive-c tutorial , read it. such fundamental thing there no excuse not reading tutorial or other documentation.
Comments
Post a Comment