ojective-c convert to pascal pattern

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://*.com/questions/16522403/how-to-convert-objective-c-property-to-delphi-xe3
上一篇:MongoDB中设置expire过期自动删除


下一篇:总结windows多线程同步互斥