1

I need some help in QuickDialog. I am using this tutorial QuickDialog but i cannot find what i would like to do in my QuickDialog.

First i have a controller A that will transfer to controller B using QuickDialog, values are in controller A. Now, my problem is how can i access the values when I'm already in controller B.

For example: i have declared QEntryElement *amountEntry = [[QEntryElement alloc] initWithTitle:@"Amount" Value:@""]; in controller A and passed this on controller B, how will i access amountEntry in controller B.

I hope i have explained it well. Please help on this.

lhencq
  • 505
  • 2
  • 6
  • 16

1 Answers1

1

You can access all values within the QRootElement. One way to do so is setting the key property of every QElement and afterwards fetch all key-value pairs into a NSMutableDicionary like so:

NSMutableDictionary *results = [[NSMutableDictionary alloc] init];
[fooRootElement fetchValueIntoObject:results];

You can use the onSelected completion code to trigger such action with a QButtonElement

QSection *confirmButtonSection = [[QSection alloc] init];
QButtonElement *confirmButton = [[QButtonElement alloc] initWithTitle:@"Accept"];
[fooRootElement addSection:confirmButtonSection];
[confirmButtonSection addElement:confirmButton];
[confirmButton setOnSelected:(^{[self fetchResultsAndCheckThemAndDismissControllerBMethod];})];

the button will then call the method on controller A which will leave you with a filled dictionary full of sweet information.

  • Is there any way other than using NSMutableDictionary? – lhencq Sep 26 '13 at 01:27
  • not without rewriting Quickdialog code afaik...sry for the late answer, had holidays for a month – drUniversalis Nov 05 '13 at 18:09
  • What's the difference between fetchValueIntoObject and fetchValueUsingBindingsIntoObject? How does the binding work? Example: I created a QSelectSection with an array of strings. I the created a QMultiline and added it to the select section. When I used [root fetchValueIntoObject] I only got the index of the selected value, and not the text from the multiselect. I'm guessing working with bind would help, but I'm not sure how to do it. Any ideas? – LMVogel Nov 27 '13 at 12:53