• 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://stackoverflow.com/questions/16522403/how-to-convert-objective-c-property-to-delphi-xe3
  • 相关阅读:
    【中山纪念中学六年级模拟赛】方格翻转 题解
    高斯消元
    net 控件开发资料
    使用自定义验证组件库扩展 Windows 窗体
    POJ 3032
    UVa 10878 Decode the tape
    C语言I博客作业03
    第十周助教总结
    第十二周助教总结
    C语言I博客作业06
  • 原文地址:https://www.cnblogs.com/cb168/p/5104194.html
Copyright © 2020-2023  润新知