Skip to content

Instantly share code, notes, and snippets.

@kuetsuhara
Last active January 1, 2016 07:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kuetsuhara/8111087 to your computer and use it in GitHub Desktop.
Save kuetsuhara/8111087 to your computer and use it in GitHub Desktop.
CBLModelでUpdate
- (void)updateDocument:(NSIndexPath *)indexPath{
// check情報を取得
ShoppingItem *item = dataArray[indexPath.row];
// Updateを準備する
NSError *err;
item.check = !item.check;
BOOL ok = [item save:&err];
if (ok) {
[table reloadData];
}
else{
[self showErrorAlert: @"Couldn't update the item"];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment