Converting to Xcode project

Generate the Xcode project

The Xcode project is automatically generated when building for the IOS, IPHONE or IPAD targets with the command-line or the plugin. For more details about how to build for iOS, see Building with command line and Building with Eclipse plugin.

For this tutorial, the HelloWorld project from the NeoMAD samples will be used.

Use the following command line from the NeoMAD install folder to generate the Xcode project for HelloWorld:

neomad -t IOS Examples/HelloWorld/HelloWorld.urs

The Xcode project will be generated at:

> Examples/HelloWorld/out/IOS/HelloWorld_IOS_1.0.0_en


the project in the output folder will be overridden each time the NeoMAD project is built again for the same target with the same parameters (ie. the generated file and directory have the same name). If you want to manually modify the Xcode project, be sure to move it to another folder to keep your modifications.

Prerequisites to open the native project

Import the project into Xcode

  • Double click on the .xcodeproj file in the project directory or open Xcode and select the .xcodeproj via File -> Open

You should then have a project view that looks like the following:

Xcode project structure

Understand the Xcode project

The Xcode project has the following hierarchy:

  • GenericResources directory containing the resources required by the NeoMAD generic API.
  • Images.xcassets directory containing the application icon and splash images
  • lib directory containing the NeoMAD libraries.
  • res directory with the resources of your application
  • src directory with your source code translated in Objective-C
  • strings directory with your localized text resources
  • SupportingFiles directory with all the project configuration files
  • xib directory with the main xib required to launch the application

Build and run the project

The next step is to launch the application on a device or a simulator.

  • Select the device or simulator on which the application should be run in the toolbar at the top
  • Click on the Run button in the toolbar at the top
Run Xcode project

Debug the project

To debug the Xcode project:

  • Click on the line of code on which you want to pause the execution to set a breakpoint
  • Click on the Run button in the toolbar at the top