Oh,it was due to the CCTableView class in Cocos2d 3.1 library. There is a method name - (float) tableView:(CCTableView*)tableView heightForRowAtIndex:(NSUInteger) index; in CCTableViewDataSource declared in CCTableView.h. Probably this method is also declared in some other class and CCTableView.m was calling this method by invoking [dataSource respondsToSelector:@selector(tableView:heightForRowAtIndex:)];.
I have changed the method name by declaring it as - (float) ccTableView:(CCTableView*)tableView heightForRowAtIndex:(NSUInteger) index; in CCTableViewDataSource and changed the corresponding invocation in CCTableView.m file by replacing [dataSource respondsToSelector:@selector(tableView:heightForRowAtIndex:)]; by [dataSource respondsToSelector:@selector(ccTableView:heightForRowAtIndex:)]; and [_dataSource tableView:self heightForRowAtIndex:i]; by [_dataSource ccTableView:self heightForRowAtIndex:i];.