Can I call [super didSelectRowAtIndex]?

Discussion in 'iOS Programming' started by mikezang, Dec 1, 2010.

  1. mikezang macrumors 6502a

    Joined:
    May 22, 2010
    Location:
    Tokyo, Japan
    #1
    I have a TableViewController and two subclasses of it, iPhoneTableViewController and iPadTableViewController.

    My question is can I call didSelectRowAtIndex in TableViewController from both subclass?
     
  2. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #2
    You can call the superclass implementation of a method from any instance of a subclass yes.
     
  3. mikezang thread starter macrumors 6502a

    Joined:
    May 22, 2010
    Location:
    Tokyo, Japan
    #3
    Yeah, like you said, I just call a method in super from DidSelectRowAtIndex from both sub class.

    When I asked this question, I thought there must have a didSelectRowAtIndex in super so that I have to call it, now I see, it is ok if I handle didSelectRowAtIndex in subclass.
     

Share This Page