Compilation error under Delphi 10.4 for DPF.iOS.Common unit
Delphi iOS Native Components
Brought to you by:
b_yaghobi
In n order to build the packcage with Delphi 10.4, you need to modify the DisposeOfAndNil procedure header in DPF.iOS.Common.pas to this:
procedure DisposeOfAndNil({$IFDEF AUTOREFCOUNT}var Obj{$ELSE}const [ref] Obj: TObject{$ENDIF});
Only then compiler will be able to build the source code. Without this change, the System.SysUtils.FreeAndNil will not accept Obj variable as argument during compilation.
The change to the header follows directly how the argument for FreeAndNil is declared in the System.SysUtils.pas, so perhaps the implementation changed in Delphi 10.4 comparing to earlier versions. If so, maybe some more conditional directives need to apply, or maybe this current declaration can also cover all the older versions, I only tested on 10.4 version of Delphi.