Menu

Access Violation on this line

Chris
2014-12-02
2014-12-10
  • Chris

    Chris - 2014-12-02

    hi
    when i try to use the TableView with custom frame, when click on the first row, there isn't any access violation. When i click on the second row, the access violation will appear as shown below with ==> marked beside it.
    If i comment off that row, the check mark on the previous row will not be removed and there won't be any access violation.

    Please advise

    thanks
    chris

    ============= DPF.iOS.UITableView ==========
    procedure TTableViewDelegate.tableView( tableView: UITableView; didDeselectRowAtIndexPath: NSIndexPath04 ); cdecl;
    var
    SecNo, RowNo : LongWord;
    CellAccessory: TTableViewCellAccessory;
    begin
    {$IFDEF DEBUG}
    DPFNSLog( '37' );
    {$ENDIF}
    if Assigned( FDPFUITableView.FOnItemDeSelect ) and ( didDeselectRowAtIndexPath.length > 0 ) then
    begin
    getSecRowIndex( didDeselectRowAtIndexPath, SecNo, RowNo );
    if FDPFUITableView.FSearchTextExists then
    begin
    SecNo := FDPFUITableView.FSearchMap[RowNo].Section;
    RowNo := FDPFUITableView.FSearchMap[RowNo].Row;
    end;

    CellAccessory := FDPFUITableView.Row[SecNo, RowNo].AccessoryType;
    FDPFUITableView.FOnItemDeSelect( Self, SecNo, RowNo, CellAccessory );
    

    ==> tableView.cellForRowAtIndexPath( didDeselectRowAtIndexPath ).setAccessoryType( Integer( CellAccessory ) );
    FDPFUITableView.Row[SecNo, RowNo].AccessoryType := CellAccessory;
    end;
    end;

     

    Last edit: Chris 2014-12-02
  • Chris

    Chris - 2014-12-04

    Hi
    It seems that if i split that line into 2 lines with a IF statement, there is no more access violation

    l_row = tableView.cellForRowAtIndexPath( didDeselectRowAtIndexPath );
    if (l_row <> nil) then
    l_row.setAccessoryType(Integery(CellAccessory));

    Is there a way to make this change at the source there?

    thanks
    chris

     
  • Sebastian Zierer

    I changed it in SVN. Please take a look at it and see if that fixes it for you.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.