iphone - 弹出时如何从主视图调用函数

标签 iphone ios xcode popviewcontroller

这可能已经被问过几次了,弹出时如何调用函数? NSlog 显示文本,但在弹出后 View 上没有任何显示。

列表弹出到表格但图像不显示

饮料 ListView Controller

DrinkTableViewController *drinkTable = [[DrinkTableViewController alloc]init];

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 
{
[[self navigationController] popToViewController:obj animated:NO];
                                 [drinkTable addImgViewAfterPopTime];
}

DrinkTableViewController

-(void)addImgViewAfterPopTime
{
    [self performSelector:@selector(addImgViewAfterPop) withObject:nil afterDelay:3];
    NSLog(@"casasasasa");
}

最佳答案

您可以创建委托(delegate)方法。并在插入 viewController 时制作

controller.delegate = self;

然后在弹出时您可以调用该委托(delegate)方法。

关于iphone - 弹出时如何从主视图调用函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10894251/

相关文章:

ios - 从 iPhone 6 中的气压计收集相对高度

objective-c - 空白的第一个 UITableView 部分标题

ios - 是否可以动态创建 swift 协议(protocol)的可选和非可选版本?

xcode - 仅当物体快速移动时如何测试碰撞

ios - 如何在 ios 中的 open fire xmpp 中从另一端的花名册中删除聊天用户

iphone - 在 Objective-C 中,我们如何称呼 "[ob method]"语法?

iphone - 有没有办法通过字符串检查它是否是一个单词然后定义它?

ios - iPhone 中的 UIImagePickerController 问题?

iOS - .ipa 文件上的应用程序调试

ios - 等待 Testflight 上的 Beta App Review