This guide assumes a few things:
- You are using Xcode 4
- You are using Git.
If you're still on Xcode 3 or do code management in another way, the steps should be equivalent, albeit not as straight forward. You should really consider upgrading ;-)
We're taking a fresh new iOS Project as an example. Integration into an existing project and/or a Desktop project should be similar.
-
Go to your project directory.
-
Add the Cocoa API Wrapper as a Git Subproject
git submodule add git://github.com/soundcloud/CocoaSoundCloudAPI.git SoundCloudAPI
-
Update the Subprojects (the API Wrapper includes the NXOAuth2Framework as a subproject)
git submodule update --init --recursive
-
Drag the
SoundCloudAPI.xcodeproj
file below your project file. If it asks you to save this as a Workspace, say yes. For projects in the root hierarchy of a workspace, Xcode ensures "implicit depenencies" between them. That's a good thing. -
To be able to find the Headers, you still need to add
SoundCloudAPI/**
to theHeader Search Path
of the main project. -
Now the Target needs to know about the new libraries it should link against. So in the Project, select the Target, and in Build Phases go to the Link Binary with Libraries section. Add the following:
libSoundCloud.a
(orSoundCloudAPI.framework
on Desktop)libOAuth2Client.a
(orOAuth2Client.framework
on Desktop)Security.framework
-
Next step is to make sure that the Linker finds everything it needs: So go to the Build settings of the project and add the following to Other Linker Flags
-all_load -ObjC
Yay, done! Congrats! Everything is set up, and you can start using it. Here's how.
So, from time to time there will be updates. For that, go to the API Wrapper directory and check out the latest version! After this, you might need to update the submodules, too. To do this, please run the following when you're done:
git submodule update --init --recursive