Am 12.11.2016 04:46 schrieb "Ryan Joseph" :
>
>
> > On Nov 12, 2016, at 3:22 AM, Jonas Maebe
wrote:
> >
> > You're passing a class, not an object. Passing a class that implements
an interface to a method that expects that interface should work fine.
Converting a class instance to an interface that
On 11/11/2016 10:14 PM, Ryan Joseph wrote:
Arr := TArray.Create;
Obj := ObjInt.GetObject;
Arr.AddObject(Obj);
[do some stuff]
// here the problems start because TArray always returns TObject
// and I can’t cast TObject to IMyInterface even though the object
// stored in the array does in fact i
> On Nov 12, 2016, at 3:29 PM, Sven Barth wrote:
> Avoid this casting by storing the interface reference. Will make your life
> much easier and your code more maintainable.
Yes storing the interface works and seems to be the best solution for now. I
did learn that generics could clean up the p