1

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:'

誰でもこれで私を助けることができますか?

前もって感謝します !

4

0 に答える 0