码迷,mamicode.com
首页 > 移动开发 > 详细

delphi ios grid bug

时间:2016-05-19 13:14:08      阅读:193      评论:0      收藏:0      [点我收藏+]

标签:

BindSourceDB4.DataSet :=nil;

BindSourceDB4.DataSet :=FDMemTable1;

grid绑定后显示数据正常,第二次赋值BindSourceDB4.DataSet就报错了。RAD berlin 存在此问题。

技术分享

 

 

windows平台下正常,IOS下报错。

Data.Bind.DBScope.pas

function TCustomBindSourceDB.CreateSubDataSource: TDataSource;
begin
  Result := TSubDataSource.Create(Self);
  Result.Name := SubDataSource; // Do not localize
  Result.SetSubComponent(True);
end;

procedure TCustomBindSourceDB.SetDataSet(const Value: TDataSet);
var
  LDataSource: TDataSource;
begin
  if Value <> DataSet then
  begin
    if Value <> nil then
    begin
      if (FDataSource = nil) or (not (csSubComponent in FDataSource.ComponentStyle)) then
      begin
        LDataSource := CreateSubDataSource;
        LDataSource.DataSet := Value;
        Self.DataSource := LDataSource;
      end;
    end
    else
      DataSource := nil;
    if FDataSource <> nil then
    begin
      FDataSource.DataSet := Value;
      SetLinks(FDataSource);
    end;
  end;
end;

 

DataSource := nil;

change to

 if DataSource<>nil then      
      DataSource.DisposeOf;
      DataSource := nil;

delphi ios grid bug

标签:

原文地址:http://www.cnblogs.com/cb168/p/5508252.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!