Runtime error Index Path

  1. 6 years ago

    Joel_Eisenstat

    5 Apr 2018 User since 2016

    Hi,
    This causes a runtime error
    Runtime Error
    Unable to convert parameter 1 to Closure.

    var indexPath = TableView1.indexPathForRowAtPoint(0) ; // <NSIndexPath: 0x169> {length = 2, path = 0 - 0}
    var r = TableView1.selectRow(indexPath, true, 0);
    Thanks
    Joel
    trying to loop a TableView list and obtain the index / identifier for each row

  2. marco

    6 Apr 2018 Administrator User since 2016

    Hi @Joel_Eisenstat, your code contains an error (a Point is expected and not a number):

    var indexPath = TableView1.indexPathForRowAtPoint(Point(0,0));
    var r = TableView1.selectRow(indexPath, true, 0);

    but unfortunately there was a bug in Creo (that we already fixed) so you should wait for the next version.

    The next beta is taking a bit more than we originally expected because we are developing some very important features that I am sure you'll love. Please be patient and then after the next beta we'll prepare for the final release.

  3. Joel_Eisenstat

    6 Apr 2018 User since 2016

    Thanks Marco , I look forward to those releases.
    Can you define Point for me. ( column/row ? )
    Regards,
    Joel

  4. marco

    6 Apr 2018 Administrator User since 2016

    A Point is defined by x,y and it should be used when you need to convert a touch coordinates to a table selection. I don't think this is really what you need.
    I think that you are looking for a way to select a row so you should use the indexPath instead.

    var index = IndexPath(1,0);
    TableView1.selectRow(index, true, 0);

    The first argument of IndexPath is the row to select (the second is the section number, use 0 in this version).

  5. Joel_Eisenstat

    6 Apr 2018 User since 2016

    Thanks , was able to use the PostgresRecord class to walk the list as well.

or Sign Up to reply!