0

I am using QuickDialog in my app to present a search dialog to the user. The problem: I have to set some defaults in the controller which means toggle a QBooleanElement or - in this particular case - select a QSelectItemElement.

Is there any method to do that?

Furthermore: Is there any documentation for QuickDialog? I can't find any :(

Thanks in advance, Christian

cschwarz
  • 1,195
  • 11
  • 24

2 Answers2

3

To set a QBooleanElement to a YES/NO value simply

QBooleanElement *qboolean = [[QBooleanElement alloc] initWithTitle:@"title" BoolValue:YES];
                    qboolean.key = @"booleanElementKey";
                    [firstSection addElement:qboolean];

If lately you need to set the value without interaction with the user, you do so by :

QBooleanElement* thisElement = (QBooleanElement*)[self.root elementWithKey:@"booleanElementKey"];
thisElement.boolValue = NO;

...
[self.quickDialogTableView reloadData];
maggix
  • 3,268
  • 1
  • 22
  • 36
0

To toggle the value in the QBooleanElement, you just need to set the property as necessary, and then call [quickdialogTableView reloadData], to refresh the table. You can also refresh cell by cell if you prefer.

Documentation for QD is still sparse, i have just started working on it. If you would like to contribute let me know! :)

Eduardo Scoz
  • 24,653
  • 6
  • 47
  • 62