watchkitios8.2wkinterfacetablewkinterfacecontroller

WKInterfaceTable's didSelectRowAtIndex never gets called in WKInterfaceController


I have a WKInterfaceController and I added a table as following:

// .h

@interface InterfaceController : WKInterfaceController
@property (weak, nonatomic) IBOutlet WKInterfaceTable *table;
@end

// .m
- (void)table:(WKInterfaceTable *)table didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    NSLog(@"did select");
}

- (void)table:(WKInterfaceTable *)table
didSelectRowAtIndex:(NSInteger)rowIndex{
    NSLog(@"did select new");
}

However neither of the two methods gets called. I was unable to find any protocol declaration for WKInterfaceTable and neither any delegate property on the table.

Is there something that I am missing here?


Solution

  • I found out that the method was never called because I had set a segue to be triggered on selection of the row on Interface builder.

    It seems that that by having no delegation and table protocols once you set a delegate it stops the didSelectRow method from being called.