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