0

I need to display three different kinds of cells in my WatchKit app. Basically a multiliner to report the results, and two singleliners to report either errors or a waiting spin. I am going by trial and error by using an assortment of setNumberOfRows and of setRowTypes, occasionally getting a crash, or conversely not being able to display the needed data and not quite understanding why those things happen. Apple is very stingy in the description by just saying to use setNumberOfRows when you have just a single type and setRowTypes when you have several. She is instead totally silent about how to change the type contents of the table, what would be done on iOS with reloadData. How is it possible to change the composition of the row types in the table in the best possible way?

Fabrizio Bartolomucci
  • 4,948
  • 8
  • 43
  • 75
  • You could use 2 tables or more table stacked on each other if you wish to make different cells. – GeneCode Oct 28 '16 at 10:54
  • Of course, but I wonder why two cells work and when I add a third one it gives this error. I would like to keep the ode simple. I submitted the bug to Apple and in the meantime I stay without the waiting spin. – Fabrizio Bartolomucci Oct 31 '16 at 13:21

1 Answers1

0

You can use this function to insert a different row type to your table.

myTable.insertRows(at: NSIndexSet(index: positionOfTable) as IndexSet, withRowType: "newRowType")
jizhihaoSAMA
  • 12,336
  • 9
  • 27
  • 49
Aciive
  • 1
  • 2