作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在 QuickDialog 中需要一些帮助。我正在使用本教程 QuickDialog但我无法在 QuickDialog 中找到我想做的事情。
首先我有一个 Controller A,它将使用 QuickDialog 传输到 Controller B,值在 Controller A 中。现在,我的问题是当我已经在 Controller B 中时如何访问这些值。
例如:我在 Controller A 中声明了 QEntryElement *amountEntry = [[QEntryElement alloc] initWithTitle:@"Amount"Value:@""];
并将其传递给 Controller B,如何我在 Controller B 中访问 amountEntry。
希望我已经解释清楚了。请对此提供帮助。
最佳答案
您可以访问 QRootElement 中的所有值。一种方法是设置每个 QElement 的键属性,然后将所有键值对提取到 NSMutableDicionary 中,如下所示:
NSMutableDictionary *results = [[NSMutableDictionary alloc] init];
[fooRootElement fetchValueIntoObject:results];
您可以使用 onSelected 完成代码通过 QButtonElement 触发此类操作
QSection *confirmButtonSection = [[QSection alloc] init];
QButtonElement *confirmButton = [[QButtonElement alloc] initWithTitle:@"Accept"];
[fooRootElement addSection:confirmButtonSection];
[confirmButtonSection addElement:confirmButton];
[confirmButton setOnSelected:(^{[self fetchResultsAndCheckThemAndDismissControllerBMethod];})];
然后该按钮将调用 Controller A 上的方法,这将为您留下一个充满甜蜜信息的字典。
关于ios - 如何从 iOs 中的 QuickDialog 获取值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18974735/
我是一名优秀的程序员,十分优秀!