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

Popular posts from this blog

JQuery Autocomplete without using label, value, id -

c++ - Accessing inactive union member and undefined behavior? -

JAVA - what is the difference between void and boolean methods? -