gpt4 book ai didi

ios - 更改警报按钮以打开屏幕

转载 作者:行者123 更新时间:2023-11-29 02:41:16 24 4
gpt4 key购买 nike

我目前有一个警报按钮,我想更改它,所以我不想点击一个单元格进入它,而是想使用该按钮。

- (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];
}

最佳答案

如果你的意思是你想要当用户滑动 tableview 行时显示的按钮来插入 viewcontroller 而不是显示警报 View ,这就是你想要做的:

- (void)swipeableTableViewCell:(SWTableViewCell *)cell didTriggerRightUtilityButtonWithIndex:(NSInteger)index
{
switch (index) {
case 0:

{
BNRDetailViewController *detailViewController = [[BNRDetailViewController alloc] init];

// Push it onto the top of the navigation controller's stack
[self.navigationController pushViewController:detailViewController
animated:YES];

[cell hideUtilityButtonsAnimated:YES];
break;
}

关于ios - 更改警报按钮以打开屏幕,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25762718/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com