Call tableView Delegate method

Discussion in 'iOS Programming' started by ilx.mac, Jul 1, 2009.

  1. ilx.mac macrumors member

    Mar 10, 2009
    hi there,

    is it possible to call the the tableview delegate method 'cellForRowAtIndexPath' outside the delegate <UITableViewDelegate>. I tried using "[self.tableView cellForRowAtIndexPath:newpath];" but its not calling that method. also its not showing any error. What i am doing wrong? Is that not possible?

    thanks in advance!
  2. PhoneyDeveloper macrumors 68040


    Sep 2, 2008
    There are two methods named cellForRowAtIndexPath. One is in the UITableView dataSource delegate protocol and the other is in UITableView. It is certainly possible to call either one.

    Calling the one in the delegate protocol is probably incorrect though. Normally only the table calls that method and your code returns the cell for that row.

    Calling the one in the table may return nil.

    Why do you want to call this method?

Share This Page