On a nearly daily basis I create iOS demo applications in Xcode with Oracle Mobile Cloud Service (MCS). When I started out building iOS apps for MCS our documentation was invaluable for how to install the MCS native SDK for iOS, and we even published a video to help beginners. But on a day by day basis given I've done this so many times I just want a simple checklist to remind me of the steps. And I'm pretty sure this will be useful for you to.
So without further explanation, as follows is a condensed set of steps you can use as a checklist for installing the MCS native SDK into a brand new iOS Xcode project:
- Download MCS iOS SDK from MCS, unzip and rename base directory 'MCS'.
- In Xcode create a new project (e.g. MyApp), Single View Application.
- From the OSX Finder drag 'n drop the MCS directory as the first node under the Xcode MyApp project. In the copy dialog ensure 'Copy items if needed’ and 'Create groups' are selected.
- With the MyApp project selected in Xcode and its 'General' page showing, navigate to the 'Linked Frameworks and Libraries' section and add three libraries: SystemConfiguration.framework, Security.framework, CoreLocation.framework.
- Select the MyApp project’s 'Build Settings' and search for 'Other Linker Flags'. Set this to '-ObjC' (without quotes, observe the case).
- Still under 'Build Settings' search for 'Search Paths'. Set 'Always Search User Paths' = Yes and 'User Header Search Paths' = ’$(PROJECT_DIR)/MCS/release-iphoneos' (without quotes) and set to 'recursive'.
- For the previous step once you click off the User Header Fields the '$(PROJECT_DIR)/MCS/release-iphoneos' should resolve to something like /Users/chris/Desktop/MyApp/MCS/release-iphoneos. In the OSX Finder double check what path the MCS subdirectory was actually added to the MyApp project then amend the User Header Fields property appropriately. A failure to do this will result in a compiler error later where Xcode will complain it can’t find OMCCore/OMCServiceProxy.h.
- In Xcode move the MCS/Documentation/OMC.plist file to a node under the project so it is more visible.
- Open the OMC.plist file 'as XML Source Code' via the right client menu and substitute the required values from the MCS MobileBackend. An example file can be seen below.
- Run the project - this should complete successfully.
An example OMC.plist file follows:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
If you're working with Objective-C you're set to go. If you're working with Swift, you also need to include a bridging header file. The instructions for doing this were covered in a recent post.