title: How can I store an interface method in a method pointer?
body: <p>There is an example:</p>
  
  <pre><code>type
    TDelegate = procedure of object;
  
    I1 = interface
    ['{31D4A1C7-668B-4969-B043-0EC93B673569}']
      procedure P1;
    end;
  
    TC1 = class(TInterfacedObject, I1)
      procedure P1;
    end;
  
  ...
  
  var
    obj: TC1;
    int: I1;
    d: TDelegate;
  begin
    obj := TC1.Create;
    ...
    int := obj; // "int" may contains TSomeAnotherObjectWhichImplementsI1
    d := obj.P1; // &lt;- that's fine
    d := int.P1; // &lt;- compiler error
  end;
  </code></pre>
  
  <p>So how can I make last operation?
  I don't know which type of object will be present at "int" variable so I can't use a typecast. But i know what it will be present anyway (because if you implement an interface, you must implement all its methods). So why i can't just get a pointer to this method? Maybe there is another way?
  Thanks.</p>