Question

I am having trouble implementing the "Getting Started" portion of using the ObjCMongoDB driver for MongoDB. Please simplify some of the instructions. I am new to Github and some of the terms do not quite click for me. Any sort of simplification or a step by step process of doing this would be helpful.

Was it helpful?

Solution

CocoaPods is a command line tool for managing Objective-C dependencies. If you're having trouble following the ObjCMongoDB Getting Started guide (or will be building a number of projects) CocoaPods should be an easier install process. As an added bonus, there are thousands of other dependencies that can be installed via CocoaPods once you're set up.

With the exception of creating your XCode project, the following steps need to be done from a command-line prompt (i.e. Terminal or iTerm).

First, install CocoaPods

$ gem install cocoapods

(You may need to sudo gem install cocoapods if you are using a default Ruby install)

Setup the CocoaPods master repo, which includes definitions of Objective C dependencies that can be installed:

$ pod setup

Create a new Xcode project (or use an existing one)

Create a new iOS or OS X project in Xcode. If you have an existing project, you can skip to the next step.

Change to the project directory

$ cd ~/src/myproject

Create a new Podfile

You can run pod init and then edit the default Podfile created, but for simplicity this will work:

$ echo "pod 'ObjCMongoDB', '~> 0.11.0'" >> Podfile

Run pod install

$ pod install 
Analyzing dependencies

Downloading dependencies
Installing ObjCMongoDB (0.11.0)
Installing mongo-c-driver (0.8.1)
Generating Pods project
Integrating client project

[!] From now on use `MyProject.xcworkspace`.

Open the workspace file in XCode

$ open MyProject.xcworkspace

#import "ObjCMongoDB.h" and get started coding your app

You should now be set to start coding with The Basics of using ObjCMongoDB.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top