• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: FreePascal unit in Cocoa project - How?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: FreePascal unit in Cocoa project - How?


  • Subject: Re: FreePascal unit in Cocoa project - How?
  • From: Jonas Maebe <email@hidden>
  • Date: Fri, 27 Feb 2009 11:49:38 +0100


On 27 Feb 2009, at 09:10, Alexander Bokovikov wrote:

BIG "thank you"!!! It's very clear and instructive code sample! Now I've understood, how to connect Pascal and ObjC.

You're welcome.

Sure, I'm understanding that! Of course, it would be nice to have it as a template too. I don't know how templates are built as well as how the're installed. I'm very new in XCode.

There is no officially supported way to create templates that I know of. You can look at how Apple's project templates are constructed and then edit an existing project file using a text editor to transform it into a template. There are some utilities out there that can help, but the project format changes a bit every now and then (although older templates usually keep working).


Now I yet need to investigate Pascal libraries, as I don't know what they contain exactly. E.g. whether I should transfer such Delphi units, as Classes, to Mac. I need at least such basic things, as TList, TObjectList, TStream, etc. Do you know anything about that?

These work fine in Free Pascal on any platform.

Perhaps it comes beyond the scope of this thread...and mailing list.

Yes, for that it's probably better to use one of the following lists:
* General Free Pascal questions: http://lists.freepascal.org/mailman/admindb/fpc-pascal
* Mac-specific Pascal questions (although you can also post them to the above list, more Mac people are on this one): http://lists.sonic.net/mailman/listinfo/mac-pascal


Some general information about porting code from Delphi to Free Pascal: http://wiki.freepascal.org/Code_Conversion_Guide

Note that you will find several references to Lazarus as well. Lazarus is an IDE, similar to but different from Delphi, for Pascal development. Lazarus ships with the LCL, the Lazarus component library. The LCL is the Free Pascal/Lazarus counterpart to the visual components of Delphi's VCL (the FCL, which contains the non-visual components, is part of Free Pascal). You can design GUIs with Lazarus just like with Delphi, except that Lazarus supports a lot more platforms.

The big advantages of Lazarus over Xcode for (Free) Pascal development are that it has full support for Pascal code completion and navigation, and that it is cross-platform. The downsides are that the Mac port is quite unpolished because few of the people working on it are long time Mac users (most come from Windows or Linux), and that it does not integrate in any way with Interface Builder (it uses its own cross-platform GUI design methodology and storage format). Nothing prevents you from using Lazarus only for editing the Pascal code, and Xcode for the integration with Objective-C and for designing the GUI, of course.

Similarly, the LCL's advantage is that it allows for reasonably easy porting of Delphi VCL code, while the downside is that the resulting interfaces don't look/feel Mac-like unless you tweak them quite a bit. There's also no Cocoa implementation of the VCL yet, only a Carbon one (although people are working on that).

I'm not aware of anyone having developed a GUI in Objective-C/Cocoa with a Pascal backend, but in all fairness I think that at this point it is indeed the best way to go. The reason is that the tools you'll use (such as Interface Builder) guide you and do so much for you, that you more easily end up with a Mac-like look&feel, even if you're not very familiar with it.

In Lazarus, it's probably easier to accidentally end up with a Windows- like interface that simply uses Mac GUI-elements, in particular if your background is developing Windows apps. You will encounter strong proponents of Lazarus/LCL on the various Pascal lists though, and you may want to check it out as well to see whether it suits you. I know of at least one shipping commercial Mac app ported from Delphi using Lazarus, and it looks/behaves ok.

Whichever way you choose, I would strongly recommend you to start by reading Apple's human interface guidelines: http://developer.apple.com/documentation/userexperience/Conceptual/AppleHIGuidelines/


Jonas _______________________________________________ Do not post admin requests to the list. They will be ignored. Xcode-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: FreePascal unit in Cocoa project - How?
      • From: Jonas Maebe <email@hidden>
References: 
 >Re: FreePascal unit in Cocoa project - How? (From: "Alexander Bokovikov" <email@hidden>)

  • Prev by Date: Re: FreePascal unit in Cocoa project - How?
  • Next by Date: Re: FreePascal unit in Cocoa project - How?
  • Previous by thread: Re: FreePascal unit in Cocoa project - How?
  • Next by thread: Re: FreePascal unit in Cocoa project - How?
  • Index(es):
    • Date
    • Thread