Delphi-Quellcode:
myObjectList := TObjectList.Create(False);
..
.
.
AObject := TMyObject.Create();
.
.
myObjectList.Add(AObject);
..
...
...
TMyObject(myObjectList.Items(Index)).MachWas;
TMyObject(myObjectList.Items(Index)).NeProperty := 45678;
TMyObject(myObjectList.Items(Index)).NeAndereProperty := 'Hallo Welt';
....
...
....
...
for i := myObjectList.Count - 1 DownTo 0 do
begin
TMyObject(myObjectList.Items[i]).Free;
myObjectList.Items[i].Delete;
end;
...
...
..
..
myObjectList.Free;
alles Wichtige steht im oberen Beispielcode...weitere Infos in der Hilfe unter
TObjectList
Gruß
Tyrael