ojective-c convert to pascal pattern

http://www.cnblogs.com/cnsoft/archive/2013/06/09/3128619.html

 Case I. Simple Class

 Objective-C

 XE4 

// Protocol

@protocol mycalcEvent

- (void) oncalcEventA : (int) inx ext1:(int) extInx1;

- (void) oncalcEventB : (int) inx ext1:(int) extInx1;

@end

 

// ObjC Class : mycalc -------

@interface mycalc : NSObject {

    BOOL busy;

    //

    id <mycalcEvent> delegate;

}

 

- (void) setDelegate:(id) delegate;

- (int) calc : (int) value;

 

@property (nonatomic, assign) id delegate;

@end

  // User Protocol -----------------------------------------------

  mycalcEvent = interface(IObjectiveC)

   procedure oncalcEventA(inx :Integer; ext1 : Integer); cdecl;

   procedure oncalcEventB(inx :Integer; ext1 : Integer); cdecl;

  end;

 

  //

  TmycalcEvent = class(TOCLocal,mycalcEvent)

  private

  public

   procedure oncalcEventA(inx :Integer; ext1 : Integer); cdecl;

   procedure oncalcEventB(inx :Integer; ext1 : Integer); cdecl;

  end;

 

  // mycalc Class  --------------------------------------------

  mycalc = interface(NSObject)

   function  calc        ( value : integer) : integer; cdecl;

   procedure setDelegate ( adelegate : pointer ); cdecl;

  end;

 

  //

  MycalcClass  = interface(NSObjectClass) end;

  TMycalc = class(TOCGenericImport<MyCalcClass, mycalc>) end;

Never giveup. Thanks the world.
http://stackoverflow.com/questions/16522403/how-to-convert-objective-c-property-to-delphi-xe3
posted on 2016-01-06 00:09  lypzxy  阅读(270)  评论(0编辑  收藏  举报