Pregunta

I am following the guide here, the iOS Couchbase guide. I am having trouble defining a pull replication. I setup a database like this:

 self.masterData = [self.manager databaseNamed:@"masterData" error:&error];
if (!self.masterData) {

    NSString *masterdataerrormessage = [NSString stringWithFormat:@"Failed to create or connect to   
master data database with error: %@", error.localizedDescription];

    UIAlertView *masterDataDBAlert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Unable 
to create or connect to local master data database", nil) 
message:NSLocalizedString(masterdataerrormessage, nil) delegate:self  
cancelButtonTitle:NSLocalizedString(@"OK", nil) otherButtonTitles:nil, nil];


    [masterDataDBAlert show];
    return NO;

    }

I have a CBLReplication property called pullMasterData. But when I TRY to do this:

self.pullMasterData = [self.masterData replicationFromURL:URL];

the selector replicationFromURL is not available on the self.masterData CBLdatabase object? I must be doing something wrong here but not sure what.

¿Fue útil?

Solución

I figured this out. I checked the CBLDatabase.h file in the Headers folder of the Couchbase Lite framework. The method to create a pull replication on the CBLDatabase object is createPullReplication, NOT replicationFromURL as noted in the iOS guide. I should of checked the headers first :-)

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top