Sign in Join
Wiki copytemporary

iOS Designer

(iOS only)

About

This package adds a designer for XIB-resource files to the Lazarus-IDE. XIB resource files are used to store iOS screen layouts and are normally designed using Xcode. The XIB-designer makes it easier to use iOS screen layouts in combination with Objective Pascal code.

iOS applications created by this package are using the Objective-Pascal language extensions in order to use the native Objective-C Cocoa and iOS SDK objects. Therefor you need a copy of the iOS-SDK Pascal headers, which are generated from the headers in the iOS SDK. Furthermore you need a Free Pascal compiler for ARM if you want to deploy your applications to a real device, or a Free Pascal compiler for the iphonesim target, if you want to test your applications on the iPhone Simulator. More information about this can be found in the iPhone/iPod development section.

This package depends on the iPhone Laz Extension package, which is used for the integration with Xcode and some utilities from the iOS SDK.

The extension does NOT provide another LCL WidgetSet (like Carbon or Cocoa) nor requires to use any.

Author

Joost van der Sluis

email: joost at cnoc dot nl

License

modified LGPL (same as the FPC RTL and the Lazarus LCL).

Download

The latest stable release can be found at svn:

text
svn co https://lazarus-ccr.svn.sourceforge.net/svnroot/lazarus-ccr/components/iosdesigner

Change Log

Dependencies / System Requirements

Status: Alpha

Known Issues:

To do:

Installation

In order to develop for iPhone or iPod, you'll need arm FPC compiler with rtl and packages installed in the system. There're 2 ways to do it: built manually via SVN or installed from a special FPC arm package. Both ways are described here.

You don't need to install ARM compiler or packages, if you're planning to use iPhone simulator only.

How to use

Quick start

Combination with XCode

It is possible to create your XIB-resource with Lazarus, save it, and then open it in the Xcode Designer. The changes that you make in the Xcode designer will be preserved when you open it again in the Lazarus Designer. To open a XIB-layout in Xcode from within the Lazarus-IDE, right-click on the grey area in the Designer-window, and select 'Show in XCode'. Each time you save the XIB-resource in Lazarus, Xcode will detect a change and will reload the file and show your latest changes. This does not work (yet) the other way around, so to view your changes made (and saved) in Xcode, you have to close and reopen the file in Lazarus.

Note that it is almost impossible to add all properties, settings and objects from the Xcode designer to the Lazarus XIB-designer. But the Lazarus XIB Designer could be used to make the first layout and to add the basic objects, and then the Xcode designer could be used to fill in all the specific settings. Also the drawing of the designer is very rough. This could also be improved, but the final result could always be showed in the Xcode designer.

If you want to deploy your application, it has to be signed. This can all be done from within Xcode. You can create a Xcode project for your Lazarus project using the Project menu -> update XCode project. Then you can open the project in Xcode and compile and run from there.

How does it work

By default the IDE creates an application-delegate. For each object that is placed onto the designer an outlet (reference) is created which links to the application-delegate. The same holds for events. It is possible to create multiple windows which are bound to one application-delegate.

How does the XIB Designer work

Normally, Lazarus designers do only work with components. In this case the objects in the designer are objective-c classes. To be able to design the XIB-resource file, some fake components are created and added to the IDE. Instead of storing their properties in memory, these fake components do use getters and setters to read their values. A XIB-file is in fact a xml-file. When the resource-file is loaded the xml is parsed and stored into a DOM-tree. All the properties get and set their values from this DOM-tree. This way, all xml-elements that are unknown to the Lazarus iOS designer are preserved.

Good to know

Examples

There are two examples, one simple 'Hello world' application, and one applications to show how to use an UITableView with a delegate that implements the UITableViewDelegate and UITableViewDataSource protocols.

Also See


From the Free Pascal wiki, page "iOS Designer", as it stood on 2015-01-18 after a change by Troyf, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.

Revision 2, last changed by WikiArchive .

Talk about this page

Nobody has opened a bench for this page yet. Sign in to open one.