开发者

Using CHDataStructures.framework on iPhone

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 SD开发者_开发技巧K 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


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:

  • "Implementing Static Libraries In iPhone"
  • "How SHOULD you make (and use) static libraries on the iPhone"
  • "Creating static library for iPhone"

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜