Home

Facebook Parse API: Working with Parse API Objects

Facebook's acquisition of @parseit gives the social giant a big mobile boost by making it easier for developers to create apps for the Facebook platform. In a three-part series, we take a deep dive into Parse.

In our previous article, we guided you through the features and benefits of Parse API, as well as the process of setting up your first Parse API account. In this article, you will actually work with Parse in Xcode, from integrating the SDK library in your project to working and interacting with the Parse objects.

For the sample code, we won’t create a new project from scratch but will “Parse-ify” an existing Apple project called The Elements, which can be downloaded here. The Elements is a sample application that provides access to the data contained in the Periodic Table of the Elements (which, of course, catalogs all the known atomic elements in the universe). The Elements provides this data in multiple formats, allowing users to sort the data by name, atomic number, symbol name, and the elements’ physical states at room temperature. We decided to use The Elements as a demonstration app because it is data-driven and uses localized plist files, which makes demonstrating the transition to cloud-based data access clearer and easier.  

Integrate Parse into your project

Before we get started, log onto your parse.com account and visit the Settings->Keys tab, as we will need the Application ID and Client Key.

Next, download the Parse SDK, from www.parse.com/docs/downloads, and make sure you choose iOS. When you finish downloading the files, unzip the downloaded file, then drag the folder with all the .framework files in Finder into the Xcode project. From within Xcode, right-click and select “Add files to TheElements” from the frameworks folder, and select the Parse frameworks folder and all the included framework files.

Next, we need to add the dependencies. Select the project file in Xcode, then the target app, then Build Phases, as illustrated below.

Click on the + button below “Link Binary with Libraries,” and add the following libraries:

  • AudioToolbox.framework
  • CFNetwork.framework
  • CoreGraphics.framework
  • CoreLocation.framework
  • MobileCoreServices.framework
  • QuartzCore.framework
  • Security.framework
  • StoreKit.framework
  • SystemConfiguration.framework
  • libz.dylib
  • libsqlite3.dylib

Next, download the Parse SDK, from www.parse.com/docs/downloads, and make sure you choose iOS. When you finish downloading the files, unzip the downloaded file, then drag the folder with all the .framework files in Finder into the Xcode project. From within Xcode, right-click and select “Add files to TheElements” from the frameworks folder, and select the Parse frameworks folder and all the included framework files.

Next, we need to add the dependencies. Select the project file in Xcode, then the target app, then Build Phases, as illustrated below.

Click on the + button below “Link Binary with Libraries,” and add the following libraries:

  • AudioToolbox.framework
  • CFNetwork.framework
  • CoreGraphics.framework
  • CoreLocation.framework
  • MobileCoreServices.framework
  • QuartzCore.framework
  • Security.framework
  • StoreKit.framework
  • SystemConfiguration.framework
  • libz.dylib
  • libsqlite3.dylib

For my complete article, you can read it exclusively on ProgrammableWeb.