objective c - Method return values -
objective c docs apple says
for object-oriented constructs of objective-c, such method return values, id replaces int default data type. (for strictly c constructs, such function return values, int remains default type.)
i thought return type , hence value predefined in method signature. give me example on doc refers to?
that line means method written such, would, default, return id:
- init { ... } or
+ array { ... } versus
- (id)init { ... } in addition, method written without explicit parameter types take in id objects.
- initwithobject:object { ... } is same as
- (id)initwithobject:(id)object { ... }
Comments
Post a Comment