Generating Mobile Application Project Code for iPhone

After developing the mobile business objects (MBOs), generate the files that implement the business logic and are required for Xcode IDE development.

Use this procedure if you are developing iPhone device applications using the Xcode IDE.
  1. From Unwired WorkSpace, right-click in the Mobile Application Diagram of the project for which you are generating code and select Generate Code.
  2. Follow the Code Generation wizard instructions to generate code appropriate for the Xcode IDE environment, by selecting Objective C as the language, iPhone as the platform, and Message-based.
    Generating Objective-C code for iPhone

    Other selections affect generated output as well.

  3. Click Finish. The class files include all methods required to create connections, synchronize deployed MBOs with the device, query objects, and so on, as defined in your MBOs.

    By default, the MBO source code and supporting documentation are generated in the project's Generated Code folder. The generated files are located in the <MBO_project_name> folder under the includes and src folders. The includes folder contains the header (*.h) files and the src folder contains the implementation (*.m) files.

    Because there is no namespace concept in Objective-C, all generated code is prefixed with packagename_. For example, "SampleApp_".


    SampleApp generated code for iPhone
    The frequently used Objective-C files in this project, described in code samples include:
    Source Code File Descriptions
    Objective-C File Description
    MBO class (for example, SampleApp_Customer.h, SampleApp_Customer.m) Include all the attributes, operations, object queries, and so on, defined in this MBO.
    synchronization parameter class (for example, SampleApp_CustomerSynchronizationParameter.h, SampleApp_CustomerSynchronizationParameter.m) Include any synchronization parameters defined in this MBO.
    Key generator classes (for example, SampleApp_KeyGenerator.h, SampleApp_KeyGenerator.m) Include generation of surrogate keys used to identify and track MBO instances and data.
    Personalization parameter classes (for example, SampleApp_PersonalizationParameters.h, SampleApp_PersonalizationParameters.m) Include any defined personalization keys.
    Note: Do not modify generated MBO API generated code directly. For MBO generated code, create a layer on top of the MBOs using patterns native to the mobile operating system development to extend and add functionality.