Developer

Creating a Project and Importing the OData Libraries and Bundles

Set up the iOS development environment by downloading the required plugins and importing the associated iOS libraries into the iOS development environment.

Prerequisites

Install the OData SDK on the Mac development machine.

Context

Procedure

  1. Start Xcode and select Create a new Xcode project.
  2. Under iOS, select Application.
  3. In the right pane, select Empty Application as the project template and click Next.
  4. Set Project Options, then choose Next.
  5. Configure library dependecies either by using a .podspec file, or by copying includes and libraries:
    Option Description
    Configuring dependencies using a .podspec file.
    1. Create a new iOS project in Xcode then close Xcode.
    2. Navigate to the project directory in Terminal, and run pod init.
    3. Copy this text into the generated Podfile to import all debug or release versions of the libraries:
      ################################## 
      platform :ios, "8.0" 
      target "<My Project Name>" do 
      inhibit_all_warnings! 
      pod 'NativeSDK-Debug/MAFReuse', :path => "~/SAP/MobileSDK3/NativeSDK/"
      // or
      pod 'NativeSDK-Release/MAFReuse', :path => "~/SAP/MobileSDK3/NativeSDK/"
        
      end 
      ################################## 
      
    4. Modify the path to match the location of /NativeSDK on your machine.
    5. Run pod install.
    6. Open the .xcworkspace file, instead of the .xcodeproj file. The workspace is now your regular working area.

    Configuring dependencies by copying includes and libraries

    1. Select a location to save the project and click Create to open it.
    2. Navigate to the <SMP_HOME>\MobileSDK<vesrion>\NativeSDK\ODataFramework\iOS\ installation directory.
    3. Copy includes and libraries of components you would like to add to your project.Select your project from the Project Navigator, and choose your application's target.
    4. Open the Build Phases tab, and within Link Binary with Libraries, add all necessary native frameworks.
    5. Choose your project, rather than a specific target, and open the Build Settings tab:
      1. In the Other Linker Flags section, add -ObjC and -all_load. If these settings are not visible, change the filter in the Build Settings bar from Basic to All.
      2. In the header search path section adjust the path to look for public header files. Depending on where you copied the header files in previous steps, the path string looks like this: $(PROJECT_DIR)/includes/public/**
      3. In the library search path section adjust the path to look for the binary files. Depending on where you copied the library files in previous steps, the path string looks like this: $(PROJECT_DIR)/libraries/$(BUILD_STYLE)-universal/*
  6. Build and run your project.