I've initialized a QLabelElement, and then later want to update its value. However explicitly setting the .value property on the instance of QLabelElement doesn't update its value. Here is a snippet of what I'm trying to do. The onSelected delegate is executed when the sayHello button is pressed, but the label element isn't updated:
@implementation MyController
{
QLabelElement *_theLabel;
}
- (id)init
{
self = [super init];
QRootElement *root = [[QRootElement alloc] init];
QSection *section = [[QSection alloc] init];
_theLabel = [[QLabelElement alloc] initWithTitle:@"The Label" Value:@""];
QSection *sectionButton = [[QSection alloc] init];
QButtonElement *sayHello = [[QButtonElement alloc] initWithTitle:@"Say Hello"];
[sections and controls added to root, etc]
sayHello.onSelected = ^{
_theLabel.value = @"Hello has been said"; //<-- this isn't working
};
//setting _theLabel.value = @"Hello has been said" here works, but not in the delegate
self.root = root;
return self;
}