I am showing records in a UITableView having UITableViewCellAccessoryDetailDisclosureButton as the cell accessory. I want to display these "Save","Send to" and "Visit" options when user click on detail disclosure button, but i have no idea how to do this. Please help me.
At first, you have to implement (this is different call from particular select row)
- (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath
inside it, you're using some code like this:
UIMenuController *menuController = [UIMenuController sharedMenuController];
AddRouteMenuItem *menuItem = [[AddRouteMenuItem alloc] initWithTitle:@"Add to push list" action:@selector(addRouteMenuButtonPressed:)];
menuItem.indexPath = pressedIndexPath;
menuController.menuItems = [NSArray arrayWithObject:menuItem];
[menuItem release];
[menuController setTargetRect:[self.tableView rectForRowAtIndexPath:pressedIndexPath] inView:self.tableView];
[menuController setMenuVisible:YES animated:YES];
You pressed index path = indexPath
last point - is a change pointer to accessory button - (void)setTargetRect:(CGRect)targetRect inView:(UIView *)targetView
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With