title: Dependency Management for iOS Library
body: <p>First off: Why is dependency management for obj-c projects such a pain?!</p>
  
  <p>I am writing a wrapper for my RESTful service in objective-c.  The server is a simple sinatra app running locally on 'http://localhost:4567'.</p>
  
  <p>I've included RestKit by following the steps outlined <a href="https://github.com/RestKit/RestKit/wiki/Installing-RestKit-in-Xcode-4.x" rel="nofollow">here</a>.
  I know RestKit is 'installed' correctly into my project because when I do <code>#import &lt;RestKit/RestKit.h&gt;</code> the project builds just fine.</p>
  
  <p>Now, I'm testing my library using SenTesting.Framework.  I have a class in my main library that looks like this:</p>
  
  <pre><code>#import "CITWCore.h"
  #import &lt;RestKit/RestKit.h&gt;
  @implementation CITWCore
  
  - (id)init
  {
      self = [super init];
      if (self) {
        RKObjectManager *manager = [RKObjectManager objectManagerWithBaseURL:@"http://localhost:4567"];
          // Initialization code here.
      }
  
      return self;
  }
  
  @end
  </code></pre>
  
  <p>And my unit test class:</p>
  
  <pre><code>#import "CITWCoreTests.h"
  
  @implementation CITWCoreTests
  
  
  - (void)testItCreatesAnInstance
  {
    CITWCore *newCoreObject = [[CITWCore alloc]init];
    STAssertNotNil(newCoreObject, @"new object should not be nil");
  }
  
  @end
  </code></pre>
  
  <p>When I run the tests using ⌘U the test fails with this message:</p>
  
  <pre><code>error: testExample (CITWCoreTests) failed: -[__NSCFString isIPAddress]: unrecognized selector sent to instance 0xa115880
  </code></pre>
  
  <p>The error is being triggered by line 292 in <a href="https://github.com/RestKit/RestKit/blob/master/Code/Network/RKClient.m" rel="nofollow">RKClient.m</a></p>
  
  <pre><code>if ([newBaseURLString isEqualToString:@"localhost"] || [hostName isIPAddress]) {
  </code></pre>
  
  <p>There is a header file in the RestKit project called "NSString+RestKit.h" which contains the -isIPAddress method declaration, and as far as I can tell it is getting included, so I have no idea why the compiler/run-time does not know about that particular method.  Is there something wrong with the way I've configured my testing target?  How can I create an instance of RKObjectManager and get this test to pass?</p>
  
  <p>More abstractly: How are people managing dependencies like this?  I'm looking at things like <a href="http://vendorkit.com/" rel="nofollow">VenderKit</a>, but it seems lacking in documentation and I don't think I have the proper understanding of how compilers and linkers work to go to that big of an abstraction.  What are some general guidelines when linking static libraries into my project, which is itself a static library?</p>