Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does method rowControllerAtIndex of WKInterfaceTable return nil?

When I run the code below, the method rowControllerAtIndex of WKInterfaceTable returns nil.

[self.outletTable setNumberOfRows:numberOfCategoriesToShow withRowType:@"rowTypeLabel"];
RowControllerTypeLabel *theRow = [self.outletTable rowControllerAtIndex:rowInTable];

What I've checked:

  1. I have made the connection between the row in the storyboard and the corresponding property in the interface of RowControllerTypeLabel.
  2. I have set the field Custom Class of my label to my custom class RowControllerTypeLabel.
  3. I have also made the connection between the table in the storyboard and the corresponding property in the interface of my interface controller.

What am I missing?

like image 251
vomako Avatar asked May 08 '15 17:05

vomako


3 Answers

For me - while the module was spelt out correctly - from copying and pasting of scenes / renaming classes - something went a miss and it was temporarily disconnected. I had to reselect the drop down for it to kick in.

enter image description here

like image 169
johndpope Avatar answered Nov 04 '22 02:11

johndpope


I forgot to set the row controller's identifier rowTypeLabel in the Attributes inspector.

I hope that this post will help others to find the problem in a shorter time than I needed.

like image 32
vomako Avatar answered Nov 04 '22 02:11

vomako


To solve you have to set the row controller's identifier in the Attributes Inspector: enter image description here

like image 5
Ricardo Avatar answered Nov 04 '22 00:11

Ricardo