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; |