[DUG] Delphi XE2, iOS and ObjectiveC Question

Jolyon Smith jsmith at deltics.co.nz
Thu Jun 14 13:59:12 NZST 2012


Well, the opening question doesn't make much sense, although it is easily
answered as a consequence:

You can't add an Objective-C unit to a Delphi project because the Delphi
compiler won't know what to do with it.

:)

I presume that what you mean is that you have some code that uses Cocoa
classes to perform FTP and that you wish to replicate or use that code from
Delphi.

To do that you will need to ensure that the appropriate Cocoa framework
classes have "bridges" in the various "MacAPI.*" units and then re-write
the Objective-C client code using these classes in Delphi.  If the required
classes don't have bridges then you will need to create them yourself (you
might need to create alternative bridges if the bridges that DO exist are
incomplete - they are provided for FireMonkey support, not general purpose
use, so if there are things that FireMonkey doesn't need then they often
aren't there at all).


Without seeing the exact code in question it's difficult to say, but it
might be simpler to create a framework in Objective-C that presents a
suitable, high level interface against which to create your Delphi
interfacing code - this could also greatly simplify or reduce the amount of
"bridging" required to expose the Objective-C to your Delphi side.

But I haven't yet reached the point in my Objective-C learning about
creating frameworks etc, let alone ever tried to create one then bridge to
it from Delphi, so although it sounds like a good theory I have no idea how
practical it might be.


Hopefully that will be enough to set you down the right track.

Regards,

Jolyon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listserver.123.net.nz/pipermail/delphi/attachments/20120614/8eb53b14/attachment.html 


More information about the Delphi mailing list