0
我目前有一个提醒按钮,我想改变,所以而不是点击一个单元格去它里面,我想使用按钮。更改提醒按钮,以打开屏幕
- (void)swipeableTableViewCell:(SWTableViewCell *)cell didTriggerRightUtilityButtonWithIndex:(NSInteger)index
{
switch (index) {
case 0:
{
NSLog(@"More button was pressed");
UIAlertView *alertTest = [[UIAlertView alloc] initWithTitle:@"Hello" message:@"More more more" delegate:nil cancelButtonTitle:@"cancel" otherButtonTitles: nil];
[alertTest show];
[cell hideUtilityButtonsAnimated:YES];
break;
}
如何集成与此:
- (void)tableView:(UITableView *)tableView
didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
BNRDetailViewController *detailViewController =
[[BNRDetailViewController alloc] init];
// Push it onto the top of the navigation controller's stack
[self.navigationController pushViewController:detailViewController
animated:YES];
}
如果您的意思是您试图在显示的警报视图上使用按钮,则需要添加一个不取消按钮并实现UIAlertViewDelegate以处理单击的警报视图按钮。在处理按钮点击的方法中,您可以初始化BNRDetailViewController并将其推送。 [alertView:didDismissWithButtonIndex:](https://developer.apple.com/library/ios/documentation/uikit/reference/UIAlertViewDelegate_Protocol/UIAlertViewDelegate/UIAlertViewDelegate.html#//apple_ref/doc/uid/TP40007548-CH3-SW1)是您需要实现的UIAlertViewDelegate方法 – trevorj 2014-09-10 11:57:20