TTMSFMXGrid and assigning object on Android

Using Delphi Berlin with update 1.
Pack version is
Grid version is

I follow the Developer's Guide for the TMS FMX Grid. Page 21 says:-

  Objects[Col, Row : Integer] : TObject

In my program I have a loop assigning the objects.

  ViewMainList.Add( MainObj );
  gridDisplay.Objects[  1,   iRow ] := TMainObj( ViewMainList.Count - 1 );

This code has been working correctly on a FMX Windows Client for many months.

Running it for the first time on Android I get the Segmentation fault (11) error on the line.

Any ideas on how to make it work on Android?

   Peter Evans

Unfortunately casting an integer to an object is not supported on Android. Please add a real object and store the integer inside that object.

Thanks for the tip. I have now changed my code and it now works on Windowsand Android