Aşağıdaki kodu çalıştırırken neden EAccessViolation kaldırılır? Yukarıdaki kod TForm1 kullanılanTList.Remove() neden bir EAccessViolation hatası üretiyor?
uses
Generics.Collections;
...
var
list: TList<TNotifyEvent>;
...
begin
list := TList<TNotifyEvent>.Create();
try
list.Add(myNotifyEvent);
list.Remove(myNotifyEvent); // EAccessViolation at address...
finally
FreeAndNil(list);
end;
end;
procedure myNotifyEvent(Sender: TObject);
begin
OutputDebugString('event'); // nebo cokoliv jineho
end;
Hmm, bu sizin sorunuzun cevabı değil. Sorunuzdaki kodla (ki şimdi olduğu gibi geçersizdir, çünkü buradaki "myNotifyEvent" ifadesi, "TNotifyEvent" imzasıyla eşleşmediğinden geçersiz olacaktır.) –