How to properly link third-party libraries in iOS

I am new to iOS development and have encountered this problem with library binding in the last few days.

I tried to use GMGridView in the project, but I can't get it to work.

This project comes as a static library, so I just drag and drop the xcodeproj file into my project. Then I added libGMGridView.a to Link Binary With Libraries, GMGridView in the target dependencies. I also added a path to the header search path.

However, Xcode still reports .h file not found error while trying to import GMGridView.h.

Can anyone give me a hand on this? Thanks in advance!

+6
source share
1 answer

There was the same problem !!! Did it work !!!! soooooooo:

  • copy the GMGridView folder from https://github.com/gmoledina/GMGridView to the project directory
  • in xcode, right-click on any group of files and select add files
  • find the GMGridView folder in the dir folder and select GMGridView.xcodeproj - (do not copy, do not create groups, not folders, add targets)
  • go to your project goals - search - HEADER_SEARCH_PATHS add-GMGridView / **
  • select Building phases in the settings - select target dependencies and add GMGridView
  • select Building Phases in the settings - link the binary libraries and add libGMGridView.a

import should be:

#import "GMGridView.h" #import <QuartzCore/QuartzCore.h> 
+16
source

Source: https://habr.com/ru/post/917842/


All Articles