zoukankan      html  css  js  c++  java
  • 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
  • 相关阅读:
    python12306抢票
    函数、迭代器、生成器、装饰器
    类(面向对象、增删改查、继承、多态、封装、反射)
    js循环、异常、函数
    js引入、注释、事件
    天融信护网面试
    Java URL处理
    Java多线程编程
    Java网络编程
    Java序列化
  • 原文地址:https://www.cnblogs.com/cb168/p/5104194.html
Copyright © 2011-2022 走看看