escoz / QuickDialog

QuickDialog - Quick and easy dialog screens for iOS
http://escoz.com/open-source/quickdialog
Other
3.07k stars 637 forks source link

ReloadCellForElements isn't working on pushed QRootElement #662

Closed msec closed 10 years ago

msec commented 10 years ago

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:

- (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]; }

msec commented 10 years ago

Realised that I had not set ".controllerName" which was required