I'm getting this warning.
'-respondsToSelector:' not found in protocol(s)
It occurs on the line marked by "HERE" below.
- (NSString *)tableView:(UITableView *)tableView
titleForFooterInSection:(NSInteger)section {
id<SetsSectionController> sectionController =
[sectionControllers objectAtIndex:section];
if ([sectionController respondsToSelector:
@selector(tableView:titleForFooterInSection:)]) { //HERE
return [sectionController tableView:tableView
titleForFooterInSection:section];
}
return nil;
}
Heres my full h files.
#import <UIKit/UIKit.h>
@interface SettingsTableViewController : UITableViewController {
NSArray *sectionControllers;
}
@end
What do i need to do to fix the error?
Either make SetsSectionController
inherit from NSObject
:
@protocol SetsSectionController <NSObject>
...or cast to id
:
if ([(id) sectionController respondsTo...])
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With