How to link third party libraries properly in iOS

ios, objective-c, static-libraries, xcode

Solution

Had the same issue!!! Made it work!!!! soooooooo:

- copy GMGridView folder from https://github.com/gmoledina/GMGridView to your project dir

- in xcode right click on any file group and choose add files

- find GMGridView folder in your folder dir and choose GMGridView.xcodeproj - (dont copy, create groups not folders, add targets)

- go to your project targets - search - HEADER_SEARCH_PATHS add- GMGridView/**

- select Building phases in settings - choose target dependencies and add GMGridView

- select Building phases in settings - link binary libraries and add libGMGridView.a

import should be:

#import "GMGridView.h"
#import <QuartzCore/QuartzCore.h>

Problem

I'm new in iOS development, and met this library linking problem in last few days. I was trying to use GMGridView in a project, but cannot make it working. This project is shipped as static library, so I just drag the xcodeproj file in my project. Then I added libGMGridView.a in Link Binary With Libraries, GMGridView in Target Dependencies. I also added the path in Header Search Paths. However, Xcode still report .h file not found error when I tried to import GMGridView.h. Could anyone give me a hand on this? Thanks in advance!

Original source

Related problems