使用 Delphi 如何检查对象的字段是否为 TList ?
我试过用这个
var
c : TRttiContext;
t : TRttiType;
f : TRttiField;
begin
c := TRttiContext.Create;
t := c.GetType(Self.ClassType);
for f in t.GetFields do begin
//check if the field is TList<T>
//check also the Generic type T
end;
end;