Please note, this blog entry is from a previous course. You might want to check out the current one.
Allow users to delete photos (i.e. they no longer appear in tables). You should do it in a way that makes it so that the UIRefreshControl does not bring them back!
Deleting of cells is enabled by providing the appropriate delegate method. There delete the current photo and save the core-data document:
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { if (editingStyle == UITableViewCellEditingStyleDelete) { Photo *photo = [self.fetchedResultsController objectAtIndexPath:indexPath]; [photo.managedObjectContext performBlock:^{ [photo delete]; [[SharedDocumentHandler sharedDocumentHandler] saveDocument]; }]; } }
Continue reading “cs193p – Assignment #6 Extra Task #2”