My issue is as follows:
1) I have the initial QRootElement with a row that is created based upon the following
-(void) populateSettingsRoot { QSection *DeviceSection = [[QSection alloc] init]; DeviceSection.title = @"Device Set Up"; [DeviceSection addElement:[self createDeviceConfigurationRoot]]; [self.root addSection:DeviceSection]; }
2) In the createDeviceConfigurationRoot, I have the following code to add a button and tie a method to it
QButtonElement * downloadSettingsButton = [[QButtonElement alloc] initWithTitle:@"Download device settings"]; downloadSettingsButton.onSelected = ^{ QEntryElement *test = (QEntryElement *) [deviceRoot elementWithKey:@"deviceInitLetter"]; test.textValue = @"Test"; [self.quickDialogTableView reloadCellForElements:entryElementToUpdate, nil]; }; [downloadDeviceSettingsSection addElement:downloadSettingsButton];
3) When I run the code and click on the button, I can see it executes the block but does not update the tableview to update the text of the element with the key @"deviceInitLetter" to "Test". I have checked to ensure that the key is set correctly
However, when I call the equivalent code for a button on the initial QRootElement (before any tableviews have been pushed onto the stack), it works.
I get the sense that maybe in the example I have specified, the code is not executing against the right root element. Am I doing something wrong?
Just so that you know my set-up:
I am using storyboards so I have subclassed QuickDialogController and used the following code:
My issue is as follows: 1) I have the initial QRootElement with a row that is created based upon the following
-(void) populateSettingsRoot { QSection *DeviceSection = [[QSection alloc] init]; DeviceSection.title = @"Device Set Up"; [DeviceSection addElement:[self createDeviceConfigurationRoot]]; [self.root addSection:DeviceSection]; }
2) In the createDeviceConfigurationRoot, I have the following code to add a button and tie a method to itQButtonElement * downloadSettingsButton = [[QButtonElement alloc] initWithTitle:@"Download device settings"]; downloadSettingsButton.onSelected = ^{ QEntryElement *test = (QEntryElement *) [deviceRoot elementWithKey:@"deviceInitLetter"]; test.textValue = @"Test"; [self.quickDialogTableView reloadCellForElements:entryElementToUpdate, nil]; }; [downloadDeviceSettingsSection addElement:downloadSettingsButton];
3) When I run the code and click on the button, I can see it executes the block but does not update the tableview to update the text of the element with the key @"deviceInitLetter" to "Test". I have checked to ensure that the key is set correctlyHowever, when I call the equivalent code for a button on the initial QRootElement (before any tableviews have been pushed onto the stack), it works.
I get the sense that maybe in the example I have specified, the code is not executing against the right root element. Am I doing something wrong?
Just so that you know my set-up:
- (id)initWithCoder:(NSCoder *)aDecoder { if ((self = [super initWithCoder:aDecoder])) { root = [[QRootElement alloc] init]; root.grouped = YES; root.title = @"Settings"; self.root = root; } return self; }
- (void)viewDidLoad { [super viewDidLoad]; [self populateSettingsRoot]; }