title: Delphi - Extract setter method's name of a property
body: <p>In the following type:</p>
  
  <pre><code>MyClass = class(TInterfacedPersistent)
  private
    FMyProperty: Integer;      
  published
    procedure setMyProperty(Value: Integer); virtual;
    property MyProperty: Integer read FMyProperty write setMyProperty;
  </code></pre>
  
  <p>I would like to know the name of the setter method of the "MyProperty" property via RTTI. I've tried the following:</p>
  
  <pre><code>    procedure ShowSetterMethodsNames(pMyObject: TObject);
      var
        vPropList: TPropList;      
        vCount, I: Integer;
      begin
        vCount:= GetPropList(pMyObject.ClassInfo, tkProperties, @vPropList);
  
        for I:= 0 to vCount -1 do
        begin
            if Assigned(vPropList[I]^.SetProc) then
              ShowMessage(pMyObject.ClassType.MethodName(vPropList[I]^.SetProc));
        end;
      end;
  </code></pre>
  
  <p>Although the pointer is not nil, all I have is an empty message. Does anybody have some tip  to me?</p>
  
  <p>P.S.: I'm using Delphi XE4, and I know I should use extended RTTI instead of classic, but anyway, I can't do what I want in both features... So, any help will be appreciated. Thanks for the replies.</p>
  
  <hr>
  
  <p><strong>FINAL EDITION, problem solved:</strong></p>
  
  <p>Here is the code working, based in the (help of my friends and...) RTTI unit (DoSetValue method of TRTTIInstanceProperty class):</p>
  
  <pre><code>procedure ShowVirtualSettersNames(pObject: Pointer);
  var
    vSetter, vPointer: Pointer;
    vPropList: TArray&lt;TRttiProperty&gt;;
    vProp: TRttiProperty;
  begin
    vPropList:= RTTIUtils.ExtractProperties(TObject(pObject).ClassType); // Helper to get properties from a type, based in extended RTTI
  
    for vProp in vPropList do
    begin
      vPointer:= TRttiInstanceProperty(vProp).PropInfo^.SetProc;
      vPointer:= PPointer(PInteger(pObject)^ + Smallint(vPointer))^;    
      ShowMessage(TObject(pObject).ClassType.MethodName(vPointer));
    end;
  end;
  </code></pre>
  
  <p>This ONLY WORKS FOR VIRTUAL SETTERS, for statics the message is empty. Thanks everyone!</p>