Non-main selector heightForRow: AtIndex in cocos2d during validation in Xcode 6
I recently updated my Xcode to 6.0.1 from 5.1.1. Although while checking out my current Cocos2d v3.1 project the iTunes store was showing me a warning
iTunes Store operation failed.
The app references non-public selectors in Payload/<AppName>.app/<AppName>:tableView:heightForRowAtIndex:
Is there any way out to resolve this warning?
source to share
Oh it was related to the CCTableView class in the 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 was also declared in some other class, and CCTableView.m
called this method by calling [dataSource respondsToSelector:@selector(tableView:heightForRowAtIndex:)];
.
I changed the name of the method by declaring it as - (float) ccTableView:(CCTableView*)tableView heightForRowAtIndex:(NSUInteger) index;
in CCTableViewDataSource
and changing the corresponding call in the file CCTableView.m
to replace [dataSource respondsToSelector:@selector(tableView:heightForRowAtIndex:)];
with [dataSource respondsToSelector:@selector(ccTableView:heightForRowAtIndex:)];
and [_dataSource tableView:self heightForRowAtIndex:i];
with [_dataSource ccTableView:self heightForRowAtIndex:i];
.
source to share