Question

I'm new to iPhone programming and I'm trying to use CHDataStructures in my project. But I'm running into some issues:

  1. When I directly try to build it right after download I get the error "Foundation/Foundation.h" no such file or directory. The Active SDK is "Use Base SDK" and the active architecture is x86_64. I believe I should set the Active SDK to the iPhone SDK but it isn't listed there;

  2. At some point (I don't remember how) I managed to tweak it and I got the iPhone SDK (simulator) in the active SDK but when I tried to build it I got the following error: "target specifies product type 'com.apple.product-type.framework', but there's no such product type for the 'iphonesimulator' platform";

And now I'm stuck. What am I doing wrong?

Thanks in advance, Nuno

Was it helpful?

Solution

CHDataStructures is a framework that was written for the Mac. Frameworks are not used on the iPhone, static libraries are employed in their place. I'd suggest creating a new Cocoa Touch Static Library project, then adding all of the source files to that static library. None of the source files for the project appear to include Cocoa.h or other Mac-specific headers, so you should be able to get this static library to compile without too much fiddling.

There are several good questions on creating and using static libraries here, including the following:

For examples of static libraries out there, I'd direct you to the Three20 and Core Plot projects.


UPDATE: CHDataStructures now supports both a Mac framework and iOS static library.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top