Setting Up the Development Environment

Import the associated iOS libraries into the iOS development environment.

Note: For more information on Xcode, refer to the Apple Developer Connection: http://developer.apple.com/tools/Xcode/.
  1. Start Xcode 4 and select Create a new Xcode project.
  2. Select iOS Application and Window-based Application as the project template, then click Next.
  3. Enter <ProjectName> as the Product Name, MyCorp as the Company Identifier, select Universal as the Device Family product, then click Next.
  4. Select the Architectures tab, and set Base SDK for All Configurations to iOS 4.3.

    Xcode Base SDK
  5. Select the Deployment tab and set the iOS Deployment Target to iOS 4.3 or iOS 4.2, as appropriate for the device version where you will deploy. Earlier SDKs and deployment targets are not supported.
  6. Select the Valid architecture as armv6 armv7 , Architectures as Optimized (armv7) and the Targeted device family as iPhone/iPad. This ensures that the build of the application can run on either iPhone or iPad.
    Note: When you migrate an existing project from an older version of Xcode to Xcode 4, you may see a build error: No architectures to compile for (ARCHS=i386, VALID_ARCHS=armv6,armv7). You can resolve this Xcode 4 issue by manually editing "Valid Architectures" under Targets, to add i386.


  7. Select a location to save the project and click Create to open it.

    Xcode creates a folder, <ProjectName>, to contain the project file, <ProjectName>.xcodeproj and another <ProjectName> folder, which contains a number of automatically generated files.

    Copy the files from your Windows machine to the <ProjectName> folder that Xcode created to contain the generated source code.

  8. Connect to the Microsoft Windows machine where Mobile SDK is installed:
    1. From the Apple Finder menu, select Go > Connect to Server.
    2. Enter the name or IP address of the machine, for example, smb://<machine DNS name> or smb://<IP Address>.
      You see the shared directory.
  9. Navigate to the <UnwiredPlatform_InstallDir>\MobileSDK\OData\iOS\ directory in the Unwired Platform installation directory, and copy the includes and libs folders to the <ProjectName>/<ProjectName> directory on your Mac.
  10. Right-click the <ProjectName> folder under the project, select Add Files to "<ProjectName>", navigate to the <ProjectName/ProjectName>/libs/Debug-universal directory, select all the libraries, unselect Copy items into destination group's folder (if needed), and click Add.

    The libraries are added to the project in the Project Navigator.

    Note: The library version corresponds to the configuration you are building. For example, if you are building for a debug version of the simulator, navigate to libs/Debug-iphonesimulator/ to add the libraries.
  11. Click the project root and then, in the middle pane, click the <ProjectName> project.
    1. In the right pane click the Build Settings tab, then scroll down to the Search Paths section.
    2. Enter the location of your includes folder ("$SRCROOT/<ProjectName>/ includes/public/**") in the Header Search Paths field.
      $SRCROOT is a macro that expands to the directory where the Xcode project file resides.
  12. Set the Other Linker Flags to -ObjC -all_load for both the release and for the debug configuration. It is important that the casing of -ObjC is correct (upper case 'O' and upper case 'C'). Objective-C only generates one symbol per class. You must force the linker to load the members of the class. You can do this with the help of the -ObjC flag. You must also force inclusion of all your objects from your static library by adding the linker flag -all_load.
  13. Add the following frameworks from the SDK to your project by clicking on the active target, and selecting Build Phase > Link Binary With Libraries. Click on the + button and select the following binaries from the list:
    • CoreFoundation.framework
    • QuartzCore.framework
    • Security.framework
    • libicucore.A.dylib
    • libstdc++.dylib
    • libz.1.2.3.dylib
  14. Select Product > Clean and then Product > Build to test the initial set up of the project. If you have correctly followed this procedure, you should receive a Build Succeeded message.