ios - Method signature return value "Class of type or subclass class" -
when have signature this:
- (uiview *)fooview;
you can return subclass of uiview
* (e.g uiscrollview
)
and when have:
- (class)anyclass;
you can return class (not instance, class itself) there way allow classes of class or subclass? e.g in psuedo code:
- ([uiview class])bazclass;
so here should able return class uiview
of of subclasses.
as specified other users, can't.
if goal instruct other programmers return method in code (overriden or delegate method), can:
- write in comment (of course...)
- create typedef
.
typedef class classofkinduiview; -(classofkinduiview)class { return [super class]; }
this won't block anything, can "talking method", escamotage, make programmers stop , think "what this??", cmd-click , read docs :-)
Comments
Post a Comment