title: fetchRequest on restkit version 0.20 - No Known Class Method
body: <p>I am moving from RestKit 0.10 to 0.20 on one of my application. I reviewed the page at <a href="https://github.com/RestKit/RestKit/wiki/Upgrading-from-v0.10.x-to-v0.20.0" rel="nofollow">https://github.com/RestKit/RestKit/wiki/Upgrading-from-v0.10.x-to-v0.20.0</a>, but didn't see this issue. </p>
  
  <ul>
  <li>edit 2013-02-09 Added mapping code and loadObjectData method *</li>
  </ul>
  
  <p>RestKit was added via CocoaPods.</p>
  
  <p>This was working in RK 0.10, then compiled in RK 0.20. This fragment does:</p>
  
  <ol>
  <li>Create the fetchRequest</li>
  <li>Add a predicate</li>
  <li>Add a sort</li>
  <li>Fetch the array of repeaters</li>
  </ol>
  
  <p>I have the following imports, in order:</p>
  
  <pre><code>// RestKit
  #import &lt;RestKit/RestKit.h&gt;
  #import &lt;RestKit/CoreData.h&gt;
  
  // Core Data
  #import "Repeaters.h"
  </code></pre>
  
  <p>Code snippet:</p>
  
  <pre><code>    NSArray *sortDescriptors;
  *1  NSFetchRequest *sortedRequest = [Repeaters fetchRequest]; // RestKit 0.10
      // NSFetchRequest *sortedRequest = [NSFetchRequest fetchRequestWithEntityName:@"Repeaters"]; // RestKit 0.20?
  
      // Predicate Filter by Grouping
      NSString *predicateString = @"";
  
      if ([appDelegate getIncludeIrlpPreference]) {
          predicateString =  [predicateString stringByAppendingFormat:@"(grouping LIKE 'irlp')"];
      }
  
      if ([appDelegate getIncludeWsiPreference]) {
          if([predicateString length] &gt; 0) predicateString = [predicateString stringByAppendingFormat:@" OR "];
          predicateString =  [predicateString stringByAppendingFormat:@"(grouping LIKE 'winsystem')"];
      }
  
      // Distance Sort
      if([selectedSegmentString isEqualToString:kRepeaterSortDistance]) {
  
          // Sort by distance
          NSSortDescriptor * sortBydistance = [[NSSortDescriptor alloc] initWithKey:@"distance" ascending:YES];
          sortDescriptors = [NSArray arrayWithObjects:sortBydistance, nil ];
  
      }
  
      // Add the Sort to the fetch request
      [sortedRequest setSortDescriptors:sortDescriptors];
  
      // Add the Predicate to the fetch request
      NSPredicate *predicate = [NSPredicate predicateWithFormat:predicateString];
      [sortedRequest setPredicate:predicate];
  
      // Fetch the data - filtered and sorted
  *2  self.repeaters = [Repeaters objectsWithFetchRequest:sortedRequest]; // RestKit 0.10
  </code></pre>
  
  <p>Mapping code for Repeaters class:</p>
  
  <pre><code> RKManagedObjectMapping *repeatersMapping = [RKManagedObjectMapping mappingForEntityWithName:kEntityRepeaters inManagedObjectStore:objectStore];
   [repeatersMapping mapKeyPath:@"callSign" toAttribute:@"callSign"];
   [repeatersMapping mapKeyPath:@"country" toAttribute:@"country"];
   [repeatersMapping mapKeyPath:@"freqOffsetPl" toAttribute:@"freqOffsetPl"];
   [repeatersMapping mapKeyPath:@"grouping" toAttribute:@"grouping"];
   [repeatersMapping mapKeyPath:@"latitudeDefault" toAttribute:@"latitudeDefault"];
   [repeatersMapping mapKeyPath:@"longitudeDefault" toAttribute:@"longitudeDefault"];
   [repeatersMapping mapKeyPath:@"locationElevation" toAttribute:@"locationElevation"];
   [repeatersMapping mapKeyPath:@"node" toAttribute:@"node"];
   [repeatersMapping mapKeyPath:@"notes" toAttribute:@"notes"];
   [repeatersMapping mapKeyPath:@"repeaterId" toAttribute:@"repeaterId"];
   [repeatersMapping mapKeyPath:@"serviceArea" toAttribute:@"serviceArea"];
   [repeatersMapping mapKeyPath:@"serviceState" toAttribute:@"serviceState"];
   [repeatersMapping mapKeyPath:@"url" toAttribute:@"url"];
   repeatersMapping.primaryKeyAttribute = kEntityRepeaterKey;
   [wsiObjectManager.mappingProvider registerMapping:repeatersMapping withRootKeyPath:@"winSystem.winSystemRepeaters.winSystemRepeater"];
  </code></pre>
  
  <p>loadObjectData method:</p>
  
  <pre><code>- (void)loadObjectData {
  
          [[RKObjectManager sharedManager] loadObjectsAtResourcePath:kWinSystemInfoXml delegate:self];
  }
  </code></pre>
  
  <p>Xcode errors:</p>
  
  <hr>
  
  <p>*1 RepeatersTableViewController.m:116:37: No known class method for selector 'fetchRequest'</p>
  
  <p>*2 RepeatersTableViewController.m:170:22: No known class method for selector 'objectsWithFetchRequest:'</p>
  
  <hr>
  
  <p>It is like the core data bits were not added to the Repeaters class.</p>
  
  <p>Is there another document for v0.10 to v0.20 conversion that would help me to see more of the changes?</p>