4

The documentation states that "This project compiles to a static library which you can include, or you can just reference the source files directly."

Here's what I've done. I've downloaded it from GitHub and unzipped it. Here are the classes I can see.

enter image description here

Now which file among these is the 'static library' that I should import into my project?

Additionally, if I just want to reference the source files, should I just copy the .h/.m files in Classes into my project? I tried doing that but throws the following error when I try to build it:

Undefined symbols for architecture i386:
"_OBJC_CLASS_$_CALayer", referenced from:
objc-class-ref in AQGridViewCell.o
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status

Can any one show me how to set this up?

NSExplorer
  • 11,849
  • 12
  • 49
  • 62

4 Answers4

17

You may try to add the QuartzCore framework to your target.

FoJjen
  • 774
  • 1
  • 6
  • 14
9

All you need to do is add the class files to your project. Use the AQGridView.xcodeproj just as a reference to see how it uses the classes. It is actually a very friendly to use library of classes.

Once you added the class files to your project, when you create a new viewController, just follow the setup. Make sure you use the delegates for it and if you want to modify the gridViewCells just extend the AQGridViewCell class.

Also, as @FoJjen mentions, make sure you add the QuartzCore.framework to your project

A Salcedo
  • 6,378
  • 8
  • 31
  • 42
3

First, add the classes. Then attach the library QuartzCore from Build Phases->LinkBinary with Libraries. That's all.

Nikhil
  • 16,194
  • 20
  • 64
  • 81
badka214
  • 31
  • 1
1

Wasted 1-2 hours myself so wanted to share it with others

I see two possible ways of achieving this (tested on Xcode 4.5)

First way - Proper referencing

  1. Ensure no other Xcode instance is open. Drag the Xcode project file (from Finder) into your project (into Xcode explorer window).
  2. Click on your project in the explorer window, go to Build Phases, under Link Binary with Libraries, add "libAQGridView.a" and QuartzCore.framework
  3. You should be all set. Just remember to include the necessary header files when you use it

Second way - Copying classes

You can have a look at the samples. It's merely copying the source code into the project (as opposed to linking it as a static library)

Ege Akpinar
  • 3,266
  • 1
  • 23
  • 29