I have two different classes made in two different units, how do i will creat circular references? in Delphi(the classes are in different units)
unit1:
Uses unit2;
type Ta = class(tobject)
public
b:Tb;
end;
Unit2:
type Tb = class(tobject)
public
a:Ta;
end;
It is indeed possible to circumvent the circular unit reference, using
class helpers.By adding a common UnitClassHelper including class helpers for both Ta and Tb it could be solved like this :
–
–
–
See also this excellent summary of
class helpers: solving-circular-unit-references-with-class-helpers