Convert a Static Library ".a" header file to Delphi

Hi,

I have bough the RedPark serial cable to connect my iPad to one of our product.  I have very little knowledge of XCode and I am trying to interface the static library with Delphi Mobile and the Fire Monkey.  I spent 2 days trying to understand how the conversion works but it seems I am missing something.

Is there someone who can help me with an example on how to proceed. I believe I have the header file converted to delphi unit.  The 2 files compile without error.  I have a class for the delegate and I have the manager (see below). 

I have instantiate TRscMgr class but it seems that I cannot access any of the function in IRPRscMgr.  How do I access them?

And second, how do I create the Delegate, it does not have a create function?

    IRscMgrDelegate = interface(IObjectiveC)
    ['{EB9EA56D-7248-4050-87AA-CC3AB751B0CE}']

        // Redpark Serial Cable has been connected and/or application moved to foreground.
        // protocol is the string which matched from the protocol list passed to initWithProtocol:
        procedure cableConnected(protocol : PNSString ); cdecl;

        // Redpark Serial Cable was disconnected and/or application moved to background
        procedure cableDisconnected; cdecl;

        // serial port status has changed
        // user can call getModemStatus or getPortStatus to get current state
        procedure portStatusChanged; cdecl;

        // bytes are available to be read (user should call read:, getDataFromBytesAvailable, or getStringFromBytesAvailable)
        procedure readBytesAvailable(length : UInt32); cdecl;

        // @optional
        // called when a response is received to a getPortConfig call
        procedure didReceivePortConfig; cdecl;

        // GPS Cable only - called with result when loop test completes.
        procedure didGpsLoopTest(pass : Boolean); cdecl;
    End;

    TRscMgrDelegate = class(TOCLocal, IRscMgrDelegate)
       ....
    end;

     IRPRscMgr = interface (NSObject)
    ['{B386C56C-BA80-4579-831B-C7A6BFC3CAC4}']
        procedure setDelegate(delegate : IRscMgrDelegate);


        // Initializes the RscMgr and reigsters for accessory connect/disconnect notifications.
        procedure init;
       .....

   end;

    //here you define static class Methods
    IRPRscMgrClass = interface(NSObjectClass)
    ['{1A24DC16-E211-404F-ACD4-FA777AB57DE1}']
    end;

    //the TOCGenericImport maps objC Classes to Delphi Interfaces when you call Create of TObjc_TestClass
    TRscMgr = class(TOCGenericImport<IRPRscMgrClass, IRPRscMgr>)
    end;
0
Marco
4/19/2014 11:42:35 PM
embarcadero.delphi.nativeapi 1236 articles. 1 followers. Follow

0 Replies
732 Views

Similar Articles

[PageSpeed] 29

Reply:

Similar Artilces:

Convert "xls" file to "txt" file
Hi, I hope someone can help. I need to convert an Excel spreadsheet to an ASCI text file, in order to import data into a datawindow. I want to try and avoid asking users to save their files as text files and there are issues surrounding the use of ODBC to link to Excel. I am currently able to view my Excel data by way of an OLE object but if I try "Getdata", only the first 72 rows are imported to a string or blob and then subsequently to the datawindow. So I am looking for an OLE function which will "save as" my file. Help would be greatly appeciated. ...

Delphi 2010 IDE throws error on "find" and "find in files"
I will greatly appreciate any advice how to cure the suddenly appeared misbehaviour: I just loaded the main project file and then tried to find code snippets fore re-use with "find" and "find in files" the Eurekalog extract is: 2.2 Address : 20EB30B6 2.3 Module Name : vclide140.bpl - (Integrated Development Environment Specific Components) 2.4 Module Version: 14.0.3593.25826 2.5 Type : EOutOfResources 2.6 Message : Unable to insert a line. 2.7 ID : 61FB 2.8 Count : 1 2.9 Status ...

Convert C Struct to Delphi (with "file" member)
I'm not sure where to post this question. Someone suggested I post it here. I need to convert the following C struct to Delphi. I think I have the right record, but I can't use the "file" member name. The C struct is: typedef struct { char file[MAX_PATH]; int index; } fileinfo; Thanks for the help. - Jeff Registered User wrote: > I'm not sure where to post this question. Someone suggested I post it here. > > I need to convert the following C struct to Delphi. I think I have the right record, but I can't use the "file" member n...

Icon example for "How to convert 256x256 ICO file to BMP in Delphi 2010? "
This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. --JivePart=_40524.zeB8CwDOH5aMJzMl Content-Type: text/plain; charset="Utf-8" Hello Remy, it is sample icon for previewing purposes only. I have found the icon on virtuallnk dot com. Regards Eric --JivePart=_40524.zeB8CwDOH5aMJzMl Content-Type: application/zip; name="Icon256.zip" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="Icon256.zip" UEsDBBQAAAAIAMRhOTT2vb9vqlICAKbJCwA...

"File" to "File$date"
Okay... Thanks for all your answers! From all, I combinded the perfext solution: rename("test.txt", "test" . &heute() . ".txt"); sub heute { return (localtime(time))[3] . (localtime(time))[4] . = ((localtime(time))[5] 1900); } Thanks ;) Andreas -----Urspr=FCngliche Nachricht----- Von: Sudarshan Raghavan [mailto:sraghav@india.hp.com]=20 Gesendet: Samstag, 14. September 2002 15:21 An: Perl beginners Betreff: Re: AW: Rename "File" to "File$date" On Sat, 14 Sep 2002, Sudarshan Raghavan wrote: >=20 > #!/...

Convert file on a path to "Stream" without the use of html "file" control
Hello, Basically I am building a CMS of sorts, I have built in the functionality to generate a thumbnail of an image that get's catalogued, I then take my original file and transfer it to the server along with the thumbnail - which is all working fine... Using the html file control accpets the following: (name - "fileImage") Dim x As Stream = fileImage.PostedFile.InputStream() Which is fine - one file at a time, however I need to build in the functionality to get all the image files from a directory and batch transfer them. basically I will have the path similar to:...

translate "static map" to Delphi?
There doesn't appear to be an equivalent language sub-forum in the Delphi section so I'll ask this here. It sort of fits: The original is C++. I'm trying to port some C++ code to Delphi and I am stymied by the map statement/command/whattheheckthatis. At one point they declare{code}static map<int,somename*> *someothername;{code}then later they use this in a procedure declaration:{code}procedure someproc(somename *someparam){code}Later I see this:{code}someothername->erase(somevalue);{code} I'm looking at all this and wondering how the heck this translates into ...

Rename "File" to "File$date"
Hy everybody in the List! I have a Problem writing a little perl application... Im a very newbie to programming and need your help :) The Problem is: I have a file "dev.txt" and I want to rename it once a day (with a = cronjob) like "dev13092002.txt" So i need to rename it with a date variable. All I have at the moment is: #!/usr/bin/perl $d =3D `date`; $d =3D /pattern1(pattern2)/; sytem("cp test.txt test`$d`.txt"); Does anyone of you know how to do that? THANKS in advance! =09 | Telematikzentrum D=FCrrwangen GmbH &am...

Convert "BCC" to "To:"
I'm guessing the answer to this is no, but I thought I'd ask. Is there any way to set GWIA to convert a "BCC:" recipient to a "To:" recipient? (Each person would be it's own To: Address) The problem we are having is that we use BCC because we don't want people to see other customers email addresses. We have found that some Spam software is tagging the e-mail as spam because the customers name is not in the "To:" field. Your thoughts or comments would be appreciated. --Matt No there isn't. Nor should there be because the recipien...

[XE2] "Delphi.Personality" and platform "Win32" missing or unavailable
Today I reinstall XE2 with update 1, when I try to run the application, I got following error message, I am sure it used to works fine before rebuilding my PC. [DCC Fatal Error] Exception Exception: Compiler for personality "Delphi.Personality" and platform "Win32" missing or unavailable. [DCC Error] Compiler for personality "Delphi.Personality" and platform "Win32" missing or unavailable. so what I can do now to work around it? solved, I removed the environment varible platform(platform=win32) and not get this error message again. > {qu...

NOT SOLVED "Delphi.Personality" and platform "win32" missing or unavailable
Hello, Just installed (21st February 2012) Delphi XE2 Starter. Build 16.0.4276.44006 *Installed Updates* (RAD Studio XE2 Delphi and C++ Builder Update 1) (BTW why can't this info be copied instead of typing from Help>About) Got: *[DCC Error] Compiler for personality "Delphi.Personality" and platform "win32" missing or unavailable* when trying to run 1st Sample VBlock (BTW why there is no standard Hello World to show that IDE works?) *In spite of CASE SOLVED:* Report #: 98901 Status: Closed "Delphi.Personality" and platform "Win32...

[XE2] "Delphi.Personality" and platform "Win32" missing or unavailable
I'm using Windows Vista Business 32-bit and C++ Builder XE2. When I create a new VCL project, add some Delphi files (.pas) to the project and try to compile, I receive the following error messages: {code} [DCC Fatal Error] Exception Exception: Compiler for personality "Delphi.Personality" and platform "Win32" missing or unavailable. [DCC Error] Compiler for personality "Delphi.Personality" and platform "Win32" missing or unavailable. {code} Normally, in C++ Builder XE, when I add some Delphi files to my projects, it compiles without any prob...

Delphi 2007 assert
The assertion message from Delphi 2007 is... "(!"SetThreadContext failed")" in ..\win32src\thread32.cpp at line 412 Any way I can patch this out? CodeGear™ Delphi® 2007 for Win32® Version 11.0.2902.10471 El 18/01/2014 21:48, Michael Leahy escribió: > The assertion message from Delphi 2007 is... > > "(!"SetThreadContext failed")" in ..\win32src\thread32.cpp at line 412 > > Any way I can patch this out? > > CodeGear™ Delphi® 2007 for Win32® Version 11.0.2902.10471 > An unofficial fix fo...

"Reply" headers similar to "Forward" headers
Name: Tony Sosa Email: tunasushiatgmaildotcom Product: Thunderbird Summary: "Reply" headers similar to "Forward" headers Comments: I need "reply" headers to look like the "forward" headers in my message replies. ----- Original Message ----- From: me To: doofus Sent: 01/01/2008 9:00:00 AM -0600 Subject: Big Tub of Goo Certain military contractors and attorneys with whom I correspond insist that reply headers like above are required for audit trails. Messages that I've sent to them are either bounced or una...

Web resources about - Convert a Static Library ".a" header file to Delphi - embarcadero.delphi.nativeapi

List of converts to Buddhism - Wikipedia, the free encyclopedia
Ajahn Brahm (born 1951), Religious teacher and student of the late Thai monk Ajahn Chah . Currently he is the abbot of the Bodhinyana Monastery, ...

Facebook Timeline For Pages: 8 Million Converts, 29 Million To Go
... reach to 98 percent of users who liked its page, as well as to double its engagement rate, during a 28-day period. Dr. Pepper hasn’t yet converted ...

Facebook stock roundup: Execs offload more stock, directors convert shares
... Bowles, the former co-chair of the now-defunct National Commission on Fiscal Responsibility and Reform, and Reed Hastings, Netflix CEO, converted ...

How to Convert Leads Into Buying Customers - The 9 Step Sales Process EVERYONE Should Use
... School of Business in Toronto on the topics of Sales and Entrepreneurship. I shared with them the sales process that I find How to Convert Leads ...

Bitcoin : Should I convert my savings to Bitcoin?
Answer (1 of 7): You should think of this question as "Should I invest all my savings in Bitcoin?", and not "Should I have my savings denominated ...

Coordinates - Calculate and Convert a Position on the App Store on iTunes
Get Coordinates - Calculate and Convert a Position on the App Store. See screenshots and ratings, and read customer reviews.

Radical plan to convert Domain Stadium into a wave park
The man behind a radical plan to convert Domain Stadium into an artificial wave park, says it will become &nbsp;a sporting spectacle for wave-starved ...

WWE diva converts to Christianity, confesses to a life of sin
Stunning wrestling diva Taryn Terrell has shared a dramatic knock-down testimony of conversion from life in the ring to life with Christ.

Microsoft converts more customers into testers with Office Insider preview program
Microsoft today launched a new preview program for consumers who subscribe to Office 365 that will give them a sneak peak at new features slated ...

'Water Bug' Robot Digests Pollution, Converts it to Electricity
The Row-Bot was capable of generating more energy than it needed.

Resources last updated: 11/25/2015 5:36:49 AM