Skip to content

Instantly share code, notes, and snippets.

@fisherds
Created August 3, 2014 04:12
Show Gist options
  • Select an option

  • Save fisherds/11c237ecc4480459c4e2 to your computer and use it in GitHub Desktop.

Select an option

Save fisherds/11c237ecc4480459c4e2 to your computer and use it in GitHub Desktop.
Endpoints iOS function used to Delete a MovieQuote
- (void) _deleteQuote:(NSString*) entityKeyToDelete {
// Make a query object
// Use the service to execute the query
// Use a callback block to handle the response
GTLQueryMoviequotes* query = [GTLQueryMoviequotes queryForMoviequoteDeleteWithEntityKey:entityKeyToDelete];
[[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:YES];
[self.service executeQuery:query completionHandler:^(GTLServiceTicket* ticket,
GTLMoviequotesMovieQuote* returnedMovieQuote,
NSError* error) {
[[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:NO];
if (error != nil) {
[self _showErrorDialog:error];
return;
}
// Delete worked. Good for us. Already done with delete on client so do nothing.
// Don't do a queryForQuotes now. It looks weird when the screen is in edit mode (the video chose poorly).
}];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment