title: Restkit "*** Assertion failure in -[RKManagedObjectMapping initWithEntity:]"
body: <p>i'm getting this assertion failure at run time when initializing Restkit:</p>
  
  <pre><code>2011-11-09 08:00:50.817 myapp[32572:207] application:didFinishLaunchingWithOptions:
  2011-11-09 08:00:50.820 myapp[32572:207] D app:myappAppDelegate.m:179 Initializing Restkit...
  2011-11-09 08:00:50.889 myapp[32572:207] D restkit.network.queue:RKRequestQueue.m:214 Queue &lt;RKRequestQueue: 0x742bde0&gt; has been unsuspended
  2011-11-09 08:00:50.889 myapp[32572:207] D restkit.network.queue:RKRequestQueue.m:48 Shared queue initialized: &lt;RKRequestQueue: 0x742bde0&gt;
  2011-11-09 08:00:50.890 myapp[32572:207] D restkit.network.queue:RKRequestQueue.m:207 Queue &lt;RKRequestQueue: 0x742bde0&gt; has been suspended
  2011-11-09 08:00:50.890 myapp[32572:207] D restkit.network:RKClient.m:250 Base URL changed for client &lt;RKClient: 0x7136a00&gt;, suspending main queue until reachability to host 'localhost' can be determined
  2011-11-09 08:00:50.973 myapp[32572:207] D app:myappAppDelegate.m:190 Begining object mapping...
  2011-11-09 08:00:50.974 myapp[32572:207] *** Assertion failure in -[RKManagedObjectMapping initWithEntity:], /Users/alex/Development/myapp/Libraries/RestKit/Code/CoreData/RKManagedObjectMapping.m:32
  sharedlibrary apply-load-rules all
  </code></pre>
  
  <p>this is the code:</p>
  
  <pre><code>// RestKit
  #import &lt;RestKit/RestKit.h&gt; 
  #import &lt;RestKit/CoreData/CoreData.h&gt;
  #import &lt;RestKit/Support/JSON/JSONKit/RKJSONParserJSONKit.h&gt;
  #import "DBManagedObjectCache.h"
  #import "DBUser.h"
  
  - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {   
  ...
  RKLogDebug(@"Initializing Restkit...");
  
  
  RKObjectManager* objectManager = [RKObjectManager objectManagerWithBaseURL:@"http://localhost:8888"];  
  //objectManager.router = [[RKDynamicRouter new] autorelease];  
  //manager.router = router;  
  
  objectManager.objectStore = [[[RKManagedObjectStore alloc] initWithStoreFilename:@"mydb.sqlite"] autorelease];
  objectManager.objectStore.managedObjectCache = [[DBManagedObjectCache new] autorelease];
  
  RKLogDebug(@"Begining object mapping...");
  RKManagedObjectMapping* userMapping = [RKManagedObjectMapping mappingForClass:[DBUser class]];
  RKLogDebug(@"Begining object mapping... 1");
  userMapping.primaryKeyAttribute = @"userID";
  userMapping.setDefaultValueForMissingAttributes = YES; // clear out any missing attributes (token on logout)
  
  ...
  }
  </code></pre>
  
  <p>this is where it fails in RKManagedObjectMapping.m:</p>
  
  <pre><code>- (id)initWithEntity:(NSEntityDescription*)entity {
  NSAssert(entity, @"Cannot initialize an RKManagedObjectMapping without an entity. Maybe you want RKObjectMapping instead?");
  ... 
  </code></pre>
  
  <p>any ideas? thanks !!!!
  kky</p>