Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 345
mm24 Avatar asked Dec 03 '25 16:12

mm24


1 Answers

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.

like image 127
mm24 Avatar answered Dec 07 '25 01:12

mm24