Import the generated MBO code and
associated libraries into the iOS development environment, to support applications enabled
with automatic reference counting
(ARC).
Prerequisites
To use these steps, request a patch from CS&S.
- Create a non-ARC static library target for the generated code.
- Select the application project file in Xcode, and click on
Add Target at the bottom of the Project
Settings screen. When prompted, select the "Cocoa Touch Static Library"
template from the Framework & Library section and click
Next.
- Enter the project name with the name you want for your library, for
example, "generatedcode_lib". Make sure the "Use Automatic Reference
Counting" option is not selected. Click on
Finish. You have created a second target in your
project.

- Delete the sample class files the wizard created
(generatedcode_lib.h, and
generatedcode_lib.m).
- Make sure the static library is not using ARC by selecting the
generatedcode_lib target, going to "Build Settings,"
and verifying "Automatic Reference Counting" is set to "NO".
- Add generated code into the static library target.
- Right click on the generatedcode_lib folder from
the Group & File view, and select Add Files to
....
- Select your generated code location, and select the option "Add to
targets" to "generatedcode_lib". Do not select <your main
target>.
- Click Add.

- Modify the build settings of the static library target.
- Select the generatedcode_lib target, and go to "Build Settings", and
to "Header Search Paths".
- Add the location of the SUP client stack includes
folder. Make sure the "Recursive" checkbox is checked.
- Link the main application target with the new static library.
- Select your main application target, then click on “Build Phase” and
expand the “Link Binary With Libraries” section.
- Click on the plus (+) button and select the new
static library from the list.
- Add the static library as a dependency.
- Select your main application target, then click on “Build Phase” and
expand the “Target Dependencies” section.
- Click on the plus (+) button and select the new
static library from the list.

- Make sure that ARC is enabled for your main application target.
- Select the main target, and go to “Build Settings”.
- Verify that Automatic Reference Counting” is set to “YES”.
- Add your ARC enabled code into the main application target.
- Import
the Sybase Unwired Platform client stack libraries to the main target. Perform the
steps in Developer Guide: iOS Object API Applications >
Development Task Flow for DOE-based Object API Applications >
Creating a Project > Importing Libraries and Code, to
import and add only the libraries to the main target. Do not add generated code to
the main target, because you have created the secondary static library target with
the generated code.
- Build your ARC-enabled main application target with the
[[unresolved text-ref: product-short-name]] client stack and generated code.
Ignore semantic issue warnings during compilation. For example:
"Semantic Issue
Type of property ‘databaseName’ does not match type of accessor ‘setDatabaseName:’"