DELPHI XE loading iOS framework

Source: Internet
Author: User

1. Load the static library *.a file

{$O-}

function Xe4_testframe:testframe; Cdecl
External ' libtestframe.a ' name ' Objc_class_$_testframe ';

2. Loading the dynamic library

Procedure Xe4_avfoundation; Cdecl
External '/system/library/frameworks/avfoundation.framework/avfoundation ';


Procedure Xe4_libz; Cdecl External '/usr/lib/libz.dylib ';

{$O +}

3. The corresponding. A file needs to be output in the deployment.

4. Need to introduce the required framework into the tool-option and update

5. Common Interface Definition

Testframe = Interface (nsobject)
[' {b02fe219-debd-4581-a33e-5f167552bf28} ']
function Testfuc (value:integer): integer; Cdecl
function Uv_initvoiceapp:integer; Cdecl
function Uv_startvoicelisten:boolean; Cdecl
function Delegate:pointer; Cdecl
Procedure Setdelegate (Delegate:pointer); Cdecl
function busy:boolean;cdecl;
Procedure Setbusy (V:boolean); cdecl;
function Uv_speak (text:nsstring): boolean;cdecl;
function isspeaking:boolean;cdecl;


End

Testframeclass = Interface (Nsobjectclass)
[' {1adaff51-4474-47a1-8d39-723ac6680d51} ']
End
Ttestframe = Class (Tocgenericimport<testframeclass, Testframe>)
End

6.delegate definition

Ios_voicedelegate = Interface (IOBJECTIVEC)
[' {3a72f24d-9b7b-4e9d-a572-f282147526d2} ']
Procedure Ios_onresult (resulttext:nsstring); Cdecl
Procedure ios_onvolumnchanged (Volumn:integer); Cdecl
End

Tios_voicedelegate = Class (Toclocal, Ios_voicedelegate)
Private
Ftestframe:tdpftestframe;
Public
Constructor Create (frame:tdpftestframe);
Procedure Ios_onresult (resulttext:nsstring); Cdecl
Procedure ios_onvolumnchanged (Volumn:integer); Cdecl
End

DELPHI XE loading iOS framework

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.