- (void)saveSelectedPeers {
NSArray *peerTxtRecords = [self.selectedPeers.allValues valueForKey:@"txtRecord"];
NSError *error = nil;
CBLJSONDict *peersDict = @{@"peers" : peerTxtRecords};
BOOL success = [self.databaseDocument.couchDatabase putLocalDocument:peersDict withID:@"selected-peers" error:&error];
if (!success) {
TFFLog(@"Error saving selected peer: %@", error);
}
}
{
peers = (
{
dev = "MacBookPro11,3";
seq = 140885;
service = "db-85190f3b780d45449c2f17f8d1d86e1f@Voyager";
user = "Brendan Duddridge";
}
);
}
On Dec 23, 2015, at 4:52 PM, Brendan Duddridge <bren...@gmail.com> wrote:
However, the success flag returns NO even though the NSError is nil on the return.
2015-12-24 22:13:17.562 Tap Forms[7006:3960085] database: CBLDatabase[<0x11c723410>db-85190f3b780d45449c2f17f8d1d86e1f]
2015-12-24 22:13:17.562 Tap Forms[7006:3960085] Error saving selected peer: (null)
Does a local doc with that ID already exist when this bug occurs? That is, does the first call with this docID succeed?