Access Violation while trying to load FMX style from resources

1k Views Asked by At

I'm trying to load a style resource using this code:

var
  Style: TFmxObject = nil;

begin
{$IFDEF IOS}
  Style := TStyleStreaming.LoadFromResource(HInstance, 'iphonestyle', RT_RCDATA); // access violation :(
{$ENDIF}
  if Assigned(Style) then
    TStyleManager.SetStyle(Style);
  Application.Initialize;
  Application.CreateForm(TfrmLogIn, frmLogIn);
  Application.Run;

end.

But I'm getting an access violation on LoadFromResource line. I've added the .style file to my project using Project\Resources and Images... menu item. Any ideas on what's causing AV?

0

There are 0 best solutions below