我刚刚将我的restkit cocoapod从0.20.0更新为0.24.0。 现在我有以下功能
-(void)fetchCategoriesOnCompletion:(myCompletion) compblock{
Mapper *mapper = [Mapper new];
RKManagedObjectStore *store = [[ASLDataModel sharedDataModel] objectStore];
NSManagedObjectContext *context = store.mainQueueManagedObjectContext;
RKObjectManager *objectManager = [mapper mapReisCategorie];
NSString *urlString = [NSString stringWithFormat:@"webservice/category/get/apikey/%@/language/%@",apikey,language];
[objectManager addFetchRequestBlock:^NSFetchRequest *(NSURL *URL) {
RKPathMatcher *pathMatcher = [RKPathMatcher pathMatcherWithPattern:[NSString stringWithFormat:@"/webservice/category/get/apikey/%@/language/%@",apikey,language]];
NSDictionary *argsDict = nil;
BOOL match = [pathMatcher matchesPath:[URL relativePath] tokenizeQueryStrings:NO parsedArguments:&argsDict];
NSLog(@"URL IS %@",[URL relativePath]);
NSLog(@"PATTERN is %@",pathMatcher.description);
if (match) {
NSFetchRequest *fetchRequest = [NSFetchRequest fetchRequestWithEntityName:@"Reiscategorie"];
return fetchRequest;
}
return nil;
}];
NSURLRequest *request = [objectManager requestWithObject:nil method:RKRequestMethodGET path:urlString parameters:nil];
NSLog(@"REQUEST URL IS %@",request.URL);
RKManagedObjectRequestOperation *operation = [objectManager managedObjectRequestOperationWithRequest:request managedObjectContext:context success:^(RKObjectRequestOperation *operation, RKMappingResult *mappingResult) {
NSError *error = nil;
BOOL success = [context save:&error];
if (!success) RKLogWarning(@"Failed saving managed object context: %@", error);
NSError *saveError = nil;
compblock(YES);
} failure:^(RKObjectRequestOperation *operation, NSError *error) {
}];
[objectManager enqueueObjectRequestOperation:operation];
}
我收到了以下错误:
No visible @interface for 'RKObjectManager' declares the selector 'addFetchRequestBlock:'
No visible @interface for 'RKObjectManager' declares the selector 'managedObjectRequestOperationWithRequest:managedObjectContext:success:failure:'
任何人都可以帮我吗?
提前致谢!