Advertisement
Guest User

Untitled

a guest
Feb 27th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. + (void)removeResponse:(PSResponse *)response {
  2.     [MagicalRecord saveWithBlockAndWait:^(NSManagedObjectContext * _Nonnull localContext) {
  3.         PSResponse *resp = [PSResponse MR_findFirstByAttribute:@"responseId" withValue:[NSString stringWithFormat:@"%zd", response.responseId]];
  4.         for (PSAnswer *answer in resp.answers) {
  5.             [answer MR_deleteEntityInContext:localContext];
  6.         }
  7.         resp.responseStateRaw = kResponseStateDeleted;
  8.     }];
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement