Reputation: 1205
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
Upvotes: 0
Views: 770
Reputation: 3278
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];
Upvotes: 3
Reputation: 24753
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! :)
Upvotes: 0