ios - 向父对象窗体弹出消息发送消息

标签 ios uibutton storyboard parent popover

我的 iOS 应用程序使用 Storyboard

它有 2 个 View Controller : - 主 Storyboard View Controller - 以及其中包含一些对象的弹出 View Controller

我在主视图 Controller 上有一个按钮,它会在我每次运行应用程序时创建程序:

*CGRect buttonFrame = CGRectMake(10., 10., 120., 50.);

oneButton = [UIButton buttonWithType:UIButtonTypeCustom]; 
[oneButton setImage:[UIImage imageNamed:[NSString stringWithFormat:@"someImage.png", img]] forState:UIControlStateNormal];
[oneButton setTag:img];
[oneButton setFrame:buttonFrame];
[oneButton addTarget:self action:@selector(pressButton:) forControlEvents:UIControlEventTouchUpInside];

[self.view addSubview:oneButton];*

此按钮的操作显示我的弹出 View :

*- (void) pressButton:(id)sender {

popoverViewController *popoverFrame = [self.storyboard instantiateViewControllerWithIdentifier:@"myPopoverView"];

popoverWithObjects = [[UIPopoverController alloc] initWithContentViewController:popoverFrame];

[popoverWithObjects presentPopoverFromRect:[sender frame] inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:NO];

}*

从现在开始,我无法向我的按钮发送任何消息或结果。 我想对我的程序按钮说(注意 - 我只有这个按钮的发送者 action:@selector(pressButton:) )popover 返回一些结果或一些弹出窗口中对象的操作发送任何内容(例如字符串) 或者换句话说,当我与弹出 View 上的按钮等任何对象交互时,我想更改父按钮标题标签

最佳答案

关于ios - 向父对象窗体弹出消息发送消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9353936/

相关文章:

ios - 自定义 UITextField 类仅适用于第一个文本字段

ios - 使用 json 数据填充 tableView

ios - 如何旋转 iOS 标签并使其贴在屏幕边缘?

ios - xcode 6 未在 Storyboard 中显示 View

ios - NSURLSession 中的 "Type of expression is ambiguous without more context"

objective-c - 动态按钮选择

ios - Swift - UIButton 覆盖 setSelected

ios - 如何将图像添加到 ios 中 uicollectionView 单元格的左上角?

ios - 准备 segue 不允许我设置下一个 viewController 的 NSString

ios - Xcode 9 Storyboard : an internal error occurred. 编辑功能可能受限