2

Right now, in SignUpController, I want to update one of QButtonElement's title using delegate, in the delegate method I can get the value from the delegate. But I can't set the value to this QButtonElement's title. The code like this:

#import <UIKit/UIKit.h>

@interface LoginViewController : QuickDialogController <QuickDialogStyleProvider>

@end

LoginViewController.m

- (void)pushSignUp:(QButtonElement *)buttonElement
{
    QRootElement *root = [[QRootElement alloc] initWithJSONFile:@"signUpForm"];
    //don't user quick*er allo iniwithroot
    SignUpController *loginController = (SignUpController *)[QuickDialogController controllerForRoot:root];
    [self.navigationController pushViewController:loginController animated:YES];
}

SignUpController.m

- (void)didGetCity:(City *)acity
{
    self.city = acity;
    NSLog(@"%@", self.city.city);//shows new york, so it's working.
    QButtonElement *locationElement = (QButtonElement *)[self.root elementWithKey:@"location"];
    [locationElement setTitle:acity.city]; // the title won't change.
    [self.quickDialogTableView reloadCellForElements:locationElement, nil];
}
yong ho
  • 3,892
  • 9
  • 40
  • 81

0 Answers0