title: UIMenu popovers in CollectionView
body: <p>This is how i set up the popovers</p>
  
  <pre><code>UIMenuItem *menuItem = [[UIMenuItem alloc] initWithTitle:@"Delete Patient"
  
                                                    action:@selector(customAction:)];
  
  
  
  [[UIMenuController sharedMenuController] setMenuItems:@[menuItem]];
  </code></pre>
  
  <p>and then add the require methods</p>
  
  <pre><code>- (BOOL)canBecomeFirstResponder {
  
  return YES;
  
  }
  
  
  
  - (BOOL)canPerformAction:(SEL)action withSender:(id)sender {
  
  
  
  NSLog(@"canPerformAction");
  
  // The selector(s) should match your UIMenuItem selector
  
  if (action == @selector(customAction:)) {
  
      return YES;
  
  }
  
  return NO;
  
  }
  
  
  
  - (void) customAction:(id) sender
  
  {
  
  for (Treatment *t in self.ptToDelete.patientRx) {
  
      [self.managedObjectContext deleteObject:t];
  
  }
  
  
  
  [self.managedObjectContext deleteObject:self.ptToDelete];
  
  
  
  NSError *error = nil;
  
  if (![self.managedObjectContext save:&amp;error]) {
  
      NSLog(@"Error! %@", error);
  
  }
  
  }
  </code></pre>
  
  <p>This works for iOS6, but now it is not. The following method is not getting called, it should be called when I tap and hold</p>
  
  <pre><code>- (BOOL)canPerformAction:(SEL)action withSender:(id)sender
  </code></pre>