Ojective-c Convert to Pascal pattern

Source: Internet
Author: User

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;

Ojective-c Convert to Pascal pattern

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.