Xcode Plug-in for Ice and Ice Touch

Xcode is the development environment of choice for Mac OS X and iPhone applications. The Xcode plug-in for Ice and Ice Touch provides seamless integration of Ice application development with the Xcode IDE, making it a breeze to create and modify Xcode projects for Ice applications.

The extension provides the following features:

  • Handles all aspects of translating Slice files
  • Incrementally recompiles Slice files after modifications
  • Maintains dependencies among Slice files
  • Highlights compilation errors in Slice source code
  • Simplifies the inclusion of Ice Touch libraries

Installation

The Xcode plug-in is included with the Ice Touch installer. If you want to use the plug-in for C++ development, you can install the plug-in separately using the IceXcode-Plugin-1.0.0.dmg installer. Alternatively, you can build the plug-in from source by downloading the Ice Touch source distribution.

Using the Plug-in

Adding Slice Files to a Project

To add an existing Slice file, select a folder in the project, select Info, and choose Add -> Existing Files...

To create a new Slice file, select a folder in the project, select Info, and choose Add -> New Files... Select the Other category and choose Empty File as the file type. Save the file with a .ice extension.

Configuring Project Settings

The Xcode plug-in is configured using the per-target info build settings, just as you would configure the compiler settings. Select a target, press Info (or Command+i ), select the build tab, and enter Slice in the Search in Build Settings field.

  • Header Search Paths: The list of directories to search for included Slice files (-I option). Note that the Ice Slice files are automatically in the header search path.
  • Ice Home: If you are building with the Ice Touch Xcode SDK, this should be left unset; otherwise, if using the command line toolkit or regular Ice, set this to the location of the installation (/opt/Ice-3.3.1 or /opt/IceTouch-1.0).
  • Permit `Ice' prefix: Pass --ice to the Slice compiler.
  • Streaming support: Pass --stream to the Slice compiler (C++ only).
  • Checksum support: Pass --checksum to the Slice compiler (C++ only).
  • Preprocessor Macros: Set the list of preprocessor macros to define (-D option).
  • Translate C++ code: If set, slice2cpp is used to translate Slice files; if unset, slice2objc is used.

You can set specific Slice compiler flags for individual Slice files by right-clicking the Slice file and selecting Info. Additional command-line options can be entered under the Build tab in Additional Compiler Flags for Target .

Xcode Project Settings for Cocoa and iPhone Applications

For Cocoa and iPhone applications, which use the Xcode SDK, you must add the following to Additional SDKs:

/Developer/SDKs/IceTouch-1.0/$(PLATFORM_NAME).sdk

In addition, for iPhone applications, when creating a new iPhone Xcode project, you must set the Code Signing Resource Rules Path to:

$(SDKROOT)/ResourceRules.plist

You must also add the following to the Frameworks folder:

CFNetwork.framework
Security.framework
Foundation.framework

For iPhone Simulator applications, the dynamically linked Ice libraries must be copied into the application directory. For our iPhone demos, this is done in the Xcode project with a post-build script as follows:

if [ $PLATFORM_NAME = iphonesimulator ]; then
cp $ADDITIONAL_SDKS/usr/local/lib/*.dylib $BUILT_PRODUCTS_DIR/$CONTENTS_FOLDER_PATH
fi

Non-SDK Builds

For non-SDK builds, you must add the location of the Ice installation to the header path (/opt/Ice-3.3.1/include for Ice 3.3.1, or /opt/IceTouch-1.0/include for Ice Touch).

In addition, for non-SDK builds, you must correctly configure Other Linker Flags.

  • For Ice 3.3.1: -L/opt/Ice-3.3.1/lib -lIce -lIceUtil
  • For Ice Touch 1.0: -L/opt/IceTouch-1.0/lib -lIceObjC

To be able to run the project from Xcode, you must set DYLD_LIBRARY_PATH correctly. Select Executables/<Target> and press Command+i. Select the Arguments tab and add the following to the Variables to be set in the environment section:

  • Name=DYLD_LIBRARY_PATH
  • Value=/opt/Ice-3.3.1/lib (for Ice 3.3.1)
  • Value=/opt/IceTouch-1.0/lib (for Ice Touch 1.0)

Generating code

The plug-in compiles a Slice file whenever you build the project. The extension tracks dependencies among Slice files in the project and recompiles only those files that require it after a change.

Source Code

The source code for the extension is part of the Ice Touch source distribution. See the INSTALL file in the archive for build and installation instructions.

Terms of Use | Privacy © 2010 ZeroC, Inc.