Delphi 如何将指针转换为IObjectiveC接口?

Delphi 如何将指针转换为IObjectiveC接口?,delphi,firemonkey,Delphi,Firemonkey,此接口在delphi源代码中声明: UILayoutSupport = interface(IObjectiveC) ['{2A1B5C8A-57CE-4423-A857-6BD6BCC61F77}'] function length: CGFloat; cdecl; end; 现在,在delphi中,我们还有以下功能: UIViewController = interface(UIResponder) ... function topLayoutGuide:

此接口在delphi源代码中声明:

  UILayoutSupport = interface(IObjectiveC)
    ['{2A1B5C8A-57CE-4423-A857-6BD6BCC61F77}']
    function length: CGFloat; cdecl;
  end;
现在,在delphi中,我们还有以下功能:

UIViewController = interface(UIResponder)
  ...
  function topLayoutGuide: Pointer; cdecl;
end;
从中我们可以看到topLayoutGuide返回UILayoutSupport


现在,如何将从topLayoutGuide获得的指针转换为UILayoutSupport

我只是想知道为什么downvoter会这样做——我认为这个问题没有任何问题,只需简单地键入cast,例如:
var LS:UILayoutSupport;指针(LS):=VC.topLayoutGuide
变量LS:UILayoutSupport;LS:=UILayoutSupport(VC.topLayoutGuide)@RemyLebeau我已经试过了,它与IObjectiveC接口不起作用:(@loki“它不起作用”-具体是什么方式?你需要更具体一些。@RemyLebeau我和loki亲自谈过-它抛出了一个AV。抱歉,没有更多信息-他可能睡着了:-)我只是想知道为什么downvoter会这样做——我认为这个问题没有任何问题,只需简单地键入cast,例如:
var LS:UILayoutSupport;指针(LS):=VC.topLayoutGuide
变量LS:UILayoutSupport;LS:=UILayoutSupport(VC.topLayoutGuide)@RemyLebeau我已经试过了,它与IObjectiveC接口不起作用:(@loki“它不起作用”-具体是什么方式?你需要更具体一些。@RemyLebeau我和loki亲自谈过-它抛出了一个AV。抱歉,没有更多信息-他可能睡着了:-)