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;
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;
==> tableView.cellForRowAtIndexPath( didDeselectRowAtIndexPath ).setAccessoryType( Integer( CellAccessory ) );
FDPFUITableView.Row[SecNo, RowNo].AccessoryType := CellAccessory;
end;
end;
Last edit: Chris 2014-12-02
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
I changed it in SVN. Please take a look at it and see if that fixes it for you.