This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void) observeValueForKeyPath:(NSString *)keyPath | |
ofObject:(id)object | |
change:(NSDictionary *)change | |
context:(void *)context | |
{ | |
// push & pull Action | |
if (object == self.pull || object == self.push) { | |
// レプリケーションモードを取得 | |
CBLReplicationMode mode; | |
if (object == self.pull){ | |
mode = _pull.mode; | |
} | |
else{ | |
mode = _push.mode; | |
} | |
LOG(@"mode %d", mode); | |
// モードによって動作を変更する | |
switch (mode) { | |
// finish or error | |
case kCBLReplicationStopped:{ | |
[self loadAllDocuments]; | |
break; | |
} | |
// db offline | |
case kCBLReplicationOffline:{ | |
break; | |
} | |
default: | |
// kCBLReplicationActive & kCBLReplicationIdle | |
break; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment