2

Totally being a newbie by to objective C this perplexing question occurred to me . So here it is,

Lets say say we have a viewcontroller that implements UITableViewDelegate.If we extends this viewcontroller does the child class inherits the UITableViewDelegate callback methods. So we can override the certain callbacks like cellForRowAtIndexPath etc. from the child class.

Have a good day

user942171
  • 57
  • 6

1 Answers1

5

Yes, absolutely. The child class will also conform to the protocol. The implementation of these methods is taken in the superclass, or in the child class if it is redefined in it.

  • Another Question can we override it using a category as well ? A call back like cellForRowAtIndexPath from the child class? – user942171 Sep 13 '11 at 10:06
  • you can but its discouraged, categories aren't a substitute for a subclass http://stackoverflow.com/q/5272451/674751 – bigkm Sep 13 '11 at 12:31