tags:

views:

20

answers:

1

Just starting to poke around iPhone development. I am trying to add an external project/library to mine (specifically the ASIHTTPRequest, http://allseeing-i.com/ASIHTTPRequest/).

I am at a bit of a loss as to how I go about actually adding this dependency to my project. I come from a Visual Studio/C# world, and in Visual Studio I know I would "Add Existing Project" to my solution file and then add a reference to the new project to my own. Or, alternatively, reference the DLL directly if it is already built.

The ASIHttpRequest project is on GitHub, and provides full source code. I just don't have any idea about how to actually get this dependency into my own project. I tried "Project -> Add To Project", and just selected the folder ASIHTTPRequest extracted out into. I see it as a sub-folder to my project now... but get a ton of build errors. I removed everything but the .h and .m files from this subfolder, and now I don't get any build errors from those resources anymore, but trying to reference a ASIHTTPRequest object in my own project gives "undeclared" errors.

Am I missing something here? Can I not of these .h and .m files in subfolders?

+1  A: 

You're on the right track. You just need to #import the ASIHTTPRequest header in the file where you want to use it. You do have to make sure you've met all the dependencies specified on the ASI site, but once you've done that, everything should work right by just doing an import like you've described. Once all that is set and everything is compiled, add this:

#import "ASIHTTPRequest.h"

to the top of the file where you want to use the library.

Matt Long
Duh, I should have known that. Thanks!
Matt