QLabel is not updating when QRadio is changed

16 views
Skip to first unread message

Billy Hwang

unread,
May 18, 2014, 2:25:26 PM5/18/14
to quick...@googlegroups.com
My code is simple, there are 2 elements, one is QRadio with 2 options @"1", @"2", the other is QLabel with value @"1", my target is QLabel will change when QRadio changed. Simple enough right?

here is some code:

NSArray *wheelSizeArray = [NSArray arrayWithObjects:@"1", @"2", nil];

QRadioElement *wheelsRadio = [[QRadioElement alloc] initWithItems:wheelSizeArray selected:0 title:@"Wheel Size"];

__weak
QRadioElement *weakWheelsRadio = wheelsRadio;

wheelsRadio.onSelected = ^{

        QLabelElement *label = (QLabelElement *)[root elementWithKey:@"result"];

        NSLog(@"%@", label.title);

        label.title = [NSString stringWithFormat:@"%@", weakWheelsRadio.selectedItem];

        [self.quickDialogTableView reloadData];

 };

QLabelElement *resultLabel = [[QLabelElement alloc] init];

resultLabel.title = wheelsRadio.selectedItem;

resultLabel.key = @"result";


When I look at the log, label.title is changing when wheelsRadio is changing. But the label in table is not.

Could anyone give me some hints please? Thanks!
Reply all
Reply to author
Forward
0 new messages