title: get method using RKObjectManager instead of RKRequestOperation - RestKit
body: <p>Below is the function which uses RKObjectRequestOperation for get method how to write the same using RKObjectManager </p>
  
  <pre><code> NSString *hostName = [NSString stringWithFormat:@"%@",[self getHostName]];
  
  NSString *urls = [[NSString alloc] initWithFormat:@"%@/randomcollection/%@/0/%li",hostName,profileId,(long)noOfItems];
  
  
  RKObjectMapping *responseMapping = [MappingProvider collectionMapping ];
  
  
  RKResponseDescriptor *responseDescriptor = [RKResponseDescriptor responseDescriptorWithMapping:responseMapping method:RKRequestMethodAny pathPattern:nil keyPath:nil statusCodes:RKStatusCodeIndexSetForClass(RKStatusCodeClassSuccessful)];
  
      NSURL *URL = [NSURL URLWithString:urls];
  
  NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:URL cachePolicy:NSURLCacheStorageAllowedInMemoryOnly timeoutInterval:90.0f];
  [request setValue:[GameManager sharedInstance].authenticatedUser.appTokenId forHTTPHeaderField:@"tokenId"];
  
  RKObjectRequestOperation *objectRequestOperation = [[RKObjectRequestOperation alloc] initWithRequest:request responseDescriptors:@[ responseDescriptor ]];
  
  
  [objectRequestOperation setCompletionBlockWithSuccess:^(RKObjectRequestOperation *operation, RKMappingResult *mappingResult) {
      if (success) {
          RKLogInfo(@"Load collection: %@", mappingResult.array);
      }
  } failure:^(RKObjectRequestOperation *operation, NSError *error) {
  
      if (failure) {
          failure(operation, error);
      }
  
  }];
  
  [objectRequestOperation start];
  </code></pre>
  
  <p>Edit: Here's what I have tried it gives me error of <em>*</em> Assertion failure in -[RKRouter URLWithRoute:object:]</p>
  
  <pre><code>      NSString *hostName = [NSString stringWithFormat:@"%@",[self getHostName]];  
     NSString* urls = [[NSString alloc]      initWithFormat:@"%@/userprofile/selectbyid/%@",hostName,profileId];
  
   RKObjectManager *manager = [RKObjectManager managerWithBaseURL:[NSURL URLWithString:urls]];
      [manager.HTTPClient setDefaultHeader:@"tokenId" value:[GameManager sharedInstance].authenticatedUser.appTokenId];
  
  RKObjectMapping *responseMapping = [MappingProvider userProfileRespMapping ];
  
  
      RKResponseDescriptor *responseDescriptor = [RKResponseDescriptor responseDescriptorWithMapping:responseMapping method:RKRequestMethodGET pathPattern:nil keyPath:nil statusCodes:RKStatusCodeIndexSetForClass(RKStatusCodeClassSuccessful)];
  
      [manager addResponseDescriptor:responseDescriptor];
  
  
      UserProfile * modelObject = [[UserProfile alloc] init];
      [modelObject setProfileId:profileId];
  
      [[RKObjectManager sharedManager] getObject:modelObject
                                            path:nil
                                      parameters:nil
                                         success:^(RKObjectRequestOperation *operation, RKMappingResult *mappingResult) {
                                                    if (success) {
                                                         RKLogInfo(@"Load collection of Userprofiles: %@", mappingResult.array);
                                                         NSLog(@"Mapping Results %@",[mappingResult.array firstObject]);
                                                      UserProfile *currentUserProfile = (UserProfile *)[mappingResult.array firstObject];
                                                         success(currentUserProfile);
                                                     }
                                         }
                                         failure:^(RKObjectRequestOperation *operation, NSError *error) {
  
                                          if (failure) {
                                                         RKLogError(@"Operation failed with error: %@", error);
                                                         failure(operation, error);
                                                     }
                                         }];
  </code></pre>