0

I´m using the Spotify API for my new iOS project and just finished the setup, but not sure I did this the right way.

I created a new project and added the CocoaLibSpotify iOS Library.xcodeproj by right clicking my project -> "Add Files...". So the CocoaLibSpotify project is embedded in my own project. I´ve also added it to Target Dependencies and Link Binary with Libraries.

The "Building iOS"-guide tells me to add a couple of frameworks and set some linker flags.

The CocoaLibSpotify project that I embedded already have these frameworks, should I add them to my project as well?

I also try to import CocoaLibSpotify.h by #import "CocoaLibSpotify.h but it does not find the file. #import <CocoaLibSpotify.h> works though.

Which header files should I import to my prjoject? (I can´t seem to find the "include" directory).

  • You must have messed up in some point. I would suggest you follow this post and do things again: [linking a static library to an iOS project](http://stackoverflow.com/questions/6124523/linking-a-static-library-to-an-ios-project-in-xcode-4) – Mohammad Faisal Sep 09 '13 at 13:36

2 Answers2

1

It looks like you've missed the part of the readme that tells you to add some "Framework Search Paths" settings - you need to add a couple of things to your build settings. Alternatively, just copy the "Empty CocoaLibSpotify Project" sample project, rename it and off you go.

iKenndac
  • 18,730
  • 3
  • 35
  • 51
0

CocoaLibSpotify is available as a CocoaPod.

Install CocoaPods

Add the following line to your PodFile

pod 'CocoaLibSpotify', '~> 2.4.4'

In Terminal go to your project's root and execute

pod install

Include this header to use CocoaLibSpotify

#import "CocoaLibSpotify.h"

Cocoapods is an easy way to manage dependencies. I have successfully included CocoaLibSpotify in my projects using this method.